ServicePeriodDescription (a column in table ServicePeriod )
---------------------------------- ---------------------------
January 2009
January 2008
January 2006 --- using the below query it updates the data like jan 09,jan 08,jan 06
update ServicePeriod set ServicePeriodDescription = left(ServicePeriodDescription,3) + ' ' + right(ServicePeriodDescription,2) where ServicePeriodDescription like '%jan%'
----------------------------------------------------------------------------------------------
Declare @qt as varchar(1000)
set @qt = ''''print @qtselect 'insert into program values ',ProgramID, ',', ProgramCode ,',', @qt+ Description + @qt from program
It creates the Insert Script for the table for columns included in the query.
----------------------------------------------------------------------------------------------
Check All check boxes either in grid or form using javascript coded in .cs file
String cbID;
String js;
int i = 0;
js = "";
for(i=2; i<(dataGrid.Items.Count+2); i++)
{
cbID = "dataGrid__" + "ctl" + i + "_chkSelect";
js += "if(document.getElementById('chkSelectAll').checked == true) {
document.getElementById('" + cbID + "').checked = false
}
else
{
document.getElementById('" + cbID + "').checked = true
};"
;}
chkSelectAll.Attributes.Add("onclick", js);
----------------------------------------------------------------------------------------------
Find whether a year is loop year or not
public static bool IsLeapYear (int year)
{
if (DateTime.IsLeapYear(year))
{
return true;
}
else
{
return false;
}}
-------------------------------------------------------------------------------------
Extract Numbers from a combineString c# Code
String str="January2007";
static string ExtractNumbers(string expr)
{
return string.Join(null, System.Text.RegularExpressions.Regex.Split(expr, "[^\\d]"));
}
static string ExtractText(string expr)
{
return string.Join(null, System.Text.RegularExpressions.Regex.Split(expr, "[^A-z]"));
}
-------------------------------------------------------------------------------------
Checking only CheckList instead of checking all CheckBoxes in a form
function chkall()
{
for (var n=0; n < document.forms[0].length; n++)
{
if (document.forms[0].elements[n].type=='checkbox'&& document.forms [0].elements[n].name.indexOf('chklstReasonCodes') > -1)
{
document.forms[0].elements[n].checked=true;
}
}
return false;
}
CheckAll
-------------------------------------------------------------------------------------
Getting values from .Net to JavaScript and placing values in DataGrid Controls
//Get the Controls of Grid Using UniqueID* Property
DropDownList ddl = (DropDownList)e.Row.FindControl("ddl");
string strcmbDOBYEARId = ddl.UniqueID;
TextBox txtResult = (TextBox)e.Row.FindControl("txtResult");
string strResult = txtResult.UniqueID;
ddl.Attributes.Add("onchange", "PulltoTextBox('" + strcmbDOBYEARId + "','" + strResult + "')");
function PulltoTextBox(ddlid,txtid)
{
var array = document.getElementById(ddlid);
var array1 = document.getElementsByName(txtid);
var sel="";
sel=array.options[array.selectedIndex].text;
array1[0].value=sel + "-" + array[0].value;
}
-------------------------------------------------------------------------------------
Wednesday, November 25, 2009
Sunday, November 22, 2009
Some Quotes i like
---In Iife we make some reIationshipsand some are made by god.
---prradhinchey పెదవులు కన్నా దానం chesey చేతులు మిన్న
---All's well that ends వెల్ (which means that problems do not matter so long as the outcome is good).
---prradhinchey పెదవులు కన్నా దానం chesey చేతులు మిన్న
---All's well that ends వెల్ (which means that problems do not matter so long as the outcome is good).
Wednesday, November 18, 2009
Master Page Related
//TO find Controls from the ContentPlaceHolder
ContentPlaceHolder mpContentPlaceHolder;
TextBox mpTextBox;
mpContentPlaceHolder =(ContentPlaceHolder)Master.FindControl("ContentPlaceHolder1");
if(mpContentPlaceHolder != null)
{
mpTextBox =
(TextBox) mpContentPlaceHolder.FindControl("TextBox1");
if(mpTextBox != null)
{
mpTextBox.Text = "TextBox found!";
}
}
ContentPlaceHolder mpContentPlaceHolder;
TextBox mpTextBox;
mpContentPlaceHolder =(ContentPlaceHolder)Master.FindControl("ContentPlaceHolder1");
if(mpContentPlaceHolder != null)
{
mpTextBox =
(TextBox) mpContentPlaceHolder.FindControl("TextBox1");
if(mpTextBox != null)
{
mpTextBox.Text = "TextBox found!";
}
}
Sunday, November 15, 2009
grid view conditional formatting
http://www.simple-talk.com/content/article.aspx?article=438
//To disp discontinued items in red and the unitsinstoock items less than '0' as blue
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{ if (e.Row.RowType == DataControlRowType.DataRow)
{
//We're only interested in Rows that contain data
//get a reference to the data used to databound the row
DataRowView drv = (DataRowView)e.Row.DataItem;
if (Convert.ToInt32(drv["UnitsInStock"]) == 0)
{
//The current product has 0 items in stock
e.Row.Font.Bold = true; //Make the font bold
e.Row.ForeColor = System.Drawing.Color.Red;
//Set the text color red
if (Convert.ToInt32(drv["UnitsOnOrder"]) > 0)
{
//The current out of stock item has already been ordered
//Make it blue
e.Row.ForeColor = System.Drawing.Color.Blue;
}
}
if ((bool)drv["Discontinued"])
{
//Discontinued product
//Add the image
Image img = new Image();
img.AlternateText = "Discontinued Product";
img.ImageAlign = ImageAlign.AbsMiddle;
img.ImageUrl = "arrow_down.gif";
img.Width = Unit.Pixel(10);
img.Height = Unit.Pixel(11);
e.Row.Cells[0].Controls.Add(img);
//Add the text as a control
e.Row.Cells[0].Controls.Add(new LiteralControl(" " + e.Row.Cells[0].Text));
} }}
-----------------------------------------------------------------------------------
string previousCat = "";
int firstRow = -1;
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//We're only interested in Rows that contain data
//get a reference to the data used to databound the row
DataRowView drv = ((DataRowView)e.Row.DataItem);
if (previousCat == drv["CategoryName"].ToString())
{
//If it's the same category as the previous one
//Increment the rowspan
if (GridView1.Rows[firstRow].Cells[0].RowSpan == 0)
GridView1.Rows[firstRow].Cells[0].RowSpan = 2;
else
GridView1.Rows[firstRow].Cells[0].RowSpan += 1;
//Remove the cell
e.Row.Cells.RemoveAt(0);
}
else //It's a new category
{
//Set the vertical alignment to top
e.Row.VerticalAlign = VerticalAlign.Top;
//Maintain the category in memory
previousCat = drv["CategoryName"].ToString();
firstRow = e.Row.RowIndex;
} }}
-------------------------------------------------------------------------------
//To disp discontinued items in red and the unitsinstoock items less than '0' as blue
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{ if (e.Row.RowType == DataControlRowType.DataRow)
{
//We're only interested in Rows that contain data
//get a reference to the data used to databound the row
DataRowView drv = (DataRowView)e.Row.DataItem;
if (Convert.ToInt32(drv["UnitsInStock"]) == 0)
{
//The current product has 0 items in stock
e.Row.Font.Bold = true; //Make the font bold
e.Row.ForeColor = System.Drawing.Color.Red;
//Set the text color red
if (Convert.ToInt32(drv["UnitsOnOrder"]) > 0)
{
//The current out of stock item has already been ordered
//Make it blue
e.Row.ForeColor = System.Drawing.Color.Blue;
}
}
if ((bool)drv["Discontinued"])
{
//Discontinued product
//Add the image
Image img = new Image();
img.AlternateText = "Discontinued Product";
img.ImageAlign = ImageAlign.AbsMiddle;
img.ImageUrl = "arrow_down.gif";
img.Width = Unit.Pixel(10);
img.Height = Unit.Pixel(11);
e.Row.Cells[0].Controls.Add(img);
//Add the text as a control
e.Row.Cells[0].Controls.Add(new LiteralControl(" " + e.Row.Cells[0].Text));
} }}
-----------------------------------------------------------------------------------
string previousCat = "";
int firstRow = -1;
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//We're only interested in Rows that contain data
//get a reference to the data used to databound the row
DataRowView drv = ((DataRowView)e.Row.DataItem);
if (previousCat == drv["CategoryName"].ToString())
{
//If it's the same category as the previous one
//Increment the rowspan
if (GridView1.Rows[firstRow].Cells[0].RowSpan == 0)
GridView1.Rows[firstRow].Cells[0].RowSpan = 2;
else
GridView1.Rows[firstRow].Cells[0].RowSpan += 1;
//Remove the cell
e.Row.Cells.RemoveAt(0);
}
else //It's a new category
{
//Set the vertical alignment to top
e.Row.VerticalAlign = VerticalAlign.Top;
//Maintain the category in memory
previousCat = drv["CategoryName"].ToString();
firstRow = e.Row.RowIndex;
} }}
-------------------------------------------------------------------------------
Saturday, September 19, 2009
Get paid for the damages to your car
Hello,
My name is Alicia. On the evening of September 5, 2008, my boyfriendand I decided to take advantage of your 3-year no interest offer onnew HDTVs at store #204 in Austin, Texas. We selected a 46" Samsung,which was sent to the front of the store to be loaded into my car.
A helpful employee loaded it into the back of my 2008 Honda Fit.Unfortunately, in this process my car bumper was damaged. Paint wasscraped off, and several gouges were left. As soon as we noticed thedamage, we called the store we had just purchased the TV from, andasked to speak to a supervisor. We were transferred to ConsumerRelations line instead. After speaking to a representative namedRenee about the issue, we were put on hold so that she could "processsome information." We waited approximately 30 minutes on hold beforegiving up and hanging up. We then called store #204 back, and askedagain to speak to a supervisor, and were again transferred to ConsumerRelations and placed on hold for an extended period of time and againnot helped. We were told by the staff member answering the phone atthe store that there were no other options on whom we could speak to,thus I am e-mailing you in attempts to receive some kind of resolutionto this issue.
We have been loyal Best Buy customers for upwards of six years. Wehave easily spent at least $20,000 between us in that time. Needlessto say, we are very disappointed in the lack of customer service wehave received in this matter.
We would like to remain Best Buy customers, and would like to giveyour office the chance to provide the superior customer service wehave received in the past. I am asking that a representative assessand arrange for repair of damages to my bumper. I have includedseveral pictures of the damage.
I look forward to hearing from you in regards to this matter.
Thank you for your time,
Alicia
My name is Alicia. On the evening of September 5, 2008, my boyfriendand I decided to take advantage of your 3-year no interest offer onnew HDTVs at store #204 in Austin, Texas. We selected a 46" Samsung,which was sent to the front of the store to be loaded into my car.
A helpful employee loaded it into the back of my 2008 Honda Fit.Unfortunately, in this process my car bumper was damaged. Paint wasscraped off, and several gouges were left. As soon as we noticed thedamage, we called the store we had just purchased the TV from, andasked to speak to a supervisor. We were transferred to ConsumerRelations line instead. After speaking to a representative namedRenee about the issue, we were put on hold so that she could "processsome information." We waited approximately 30 minutes on hold beforegiving up and hanging up. We then called store #204 back, and askedagain to speak to a supervisor, and were again transferred to ConsumerRelations and placed on hold for an extended period of time and againnot helped. We were told by the staff member answering the phone atthe store that there were no other options on whom we could speak to,thus I am e-mailing you in attempts to receive some kind of resolutionto this issue.
We have been loyal Best Buy customers for upwards of six years. Wehave easily spent at least $20,000 between us in that time. Needlessto say, we are very disappointed in the lack of customer service wehave received in this matter.
We would like to remain Best Buy customers, and would like to giveyour office the chance to provide the superior customer service wehave received in the past. I am asking that a representative assessand arrange for repair of damages to my bumper. I have includedseveral pictures of the damage.
I look forward to hearing from you in regards to this matter.
Thank you for your time,
Alicia
Drop Dead Letter
(Date)
To Whom It May Concern:
I have been contacted by your company about a debt you allege I owe. I am instructing you not to contact me further in connection with this debt. Under the Fair Debt Collection Practices Act, a federal law, you may not contact me further once I have notified you not to do so.
Sincerely,
(Name)
(Account No.)
To Whom It May Concern:
I have been contacted by your company about a debt you allege I owe. I am instructing you not to contact me further in connection with this debt. Under the Fair Debt Collection Practices Act, a federal law, you may not contact me further once I have notified you not to do so.
Sincerely,
(Name)
(Account No.)
Polite Letter Gets Bank Of America To Refund Overdraft Fees
Jenn's checking account with Bank of America recently had a policy change designed to increase overdraft fees, and it worked: sometime between Friday night and Saturday morning she was hit with 6 NSF charges going back the previous 48 hours, because she was about 15 minutes late transferring funds into her account the day before. Technically she had broken the new policy, but Jenn hadn't realized or remembered that there was a policy change and she was taken by surprise. She decided to try to reason with BoA's corporate office about the fees, and explain why she thought they were unfair.
Today, she let us know that her letter worked: "Just got off the phone with BoA Corporate in Boston. They're refunding everything! It pays to write."
We think it's worth looking at her letter as an example of how to present your side of an issue to a large company. Jenn is polite, and her letter is professional and well-written. She makes a point of explaining why she chose to become a BoA customer in the first place, and how she's been an advocate for them in the past—and then points out that this policy change has the effect of ruining her goodwill toward the company by making them "just like every other bank. It's the reason I left Chase."
Of course, Bank of America isn't rescinding the new policy, so it's not like Jenn's letter changed the world or anything. But it does show that it occasionally pays to write a solid letter to the corporate office if you can't resolve your issue at a branch.
May 7, 2008
Dear Mr. Lewis,
I am writing you to lodge a formal complaint about 6 overdraft fees that were recently charged to my account.
I am a dedicated online banker. I love Bank of America’s to-the-minute online status updates. It is just one of the many reasons I switched to BoA from Chase two years ago. I am also an artist, who though salaried, lives to the penny every month to make ends meet. I check my bank account online every single day. Sometimes three or four times a day.
Since joining BoA I have operated under the “as long as there is a positive amount in the account at the end of the day, you won’t get charged an overdraft fee” rule. Up until last week, that was true. I frequently buy a sandwich for lunch at noon if I know I’ll be able to deposit $20 by 5pm. So I was completely shocked to see two overdraft charges show up on a Saturday morning when on Friday night my account was in the black. What’s worse is that the two fees were charged for transactions made on Thursday and so were backdated, thus also overdrafting every transaction I made on Friday accumulating another four $35 fees!
Yesterday I went into the Lincoln & Ashland branch in Chicago, IL to dispute the fact that I was charged overdraft fees on a positive account. My account details were printed and scoured by 3 different CSRs. No one could understand the charges. But no one could do anything about them. They then made a call to Account Services and discovered that apparently the fees were legitimate because of a new rule just instated last month that removes available funds from the account the minute the card is swiped. So because I had bought some lunch just before I transferred money into my account to cover it I was penalized $210 for what amounted to a 15 minute technicality. The CSRs sent me away and told me to plead my case to the customer service number. At the 800-number I was eventually able to talk to “a manager” Jessica, who read me the verbiage that had appeared on customer statements about this change. So, indeed, the charges are apparently my fault. Thankfully, Jessica gave me a courtesy refund for 3 of them, which helps a little.
My complaint is about this new policy. It makes you just like every other bank. It is the reason I left Chase. I thought BoA was different! And I have recommended BoA to MANY of my artist friends because of that flexibility and that, until now, I have had nothing but wonderful experiences with your employees and with my account management.
Unfortunately, the remaining $105 that is now tied up in fees will ensure that my rent check this month bounces which means I will be charged more fees in addition to NSF fees from my rental company, and it is all I had budgeted for food for the first two weeks of this month. The good news is I just got a promotion at work which will, in another month, enable me to pick up and repay this set-back, sign up for automatic deposits, get money into my Savings account that might actually stay there and start to invest in some sort of stability for my future.
I’m just going to have to think long and hard about whether I want to continue doing all of those things with your bank.
Thank you for your time.
Jennifer
Ref:http://consumerist.com/5009230/polite-letter-gets-bank-of-america-to-refund-overdraft-fees
Today, she let us know that her letter worked: "Just got off the phone with BoA Corporate in Boston. They're refunding everything! It pays to write."
We think it's worth looking at her letter as an example of how to present your side of an issue to a large company. Jenn is polite, and her letter is professional and well-written. She makes a point of explaining why she chose to become a BoA customer in the first place, and how she's been an advocate for them in the past—and then points out that this policy change has the effect of ruining her goodwill toward the company by making them "just like every other bank. It's the reason I left Chase."
Of course, Bank of America isn't rescinding the new policy, so it's not like Jenn's letter changed the world or anything. But it does show that it occasionally pays to write a solid letter to the corporate office if you can't resolve your issue at a branch.
May 7, 2008
Dear Mr. Lewis,
I am writing you to lodge a formal complaint about 6 overdraft fees that were recently charged to my account.
I am a dedicated online banker. I love Bank of America’s to-the-minute online status updates. It is just one of the many reasons I switched to BoA from Chase two years ago. I am also an artist, who though salaried, lives to the penny every month to make ends meet. I check my bank account online every single day. Sometimes three or four times a day.
Since joining BoA I have operated under the “as long as there is a positive amount in the account at the end of the day, you won’t get charged an overdraft fee” rule. Up until last week, that was true. I frequently buy a sandwich for lunch at noon if I know I’ll be able to deposit $20 by 5pm. So I was completely shocked to see two overdraft charges show up on a Saturday morning when on Friday night my account was in the black. What’s worse is that the two fees were charged for transactions made on Thursday and so were backdated, thus also overdrafting every transaction I made on Friday accumulating another four $35 fees!
Yesterday I went into the Lincoln & Ashland branch in Chicago, IL to dispute the fact that I was charged overdraft fees on a positive account. My account details were printed and scoured by 3 different CSRs. No one could understand the charges. But no one could do anything about them. They then made a call to Account Services and discovered that apparently the fees were legitimate because of a new rule just instated last month that removes available funds from the account the minute the card is swiped. So because I had bought some lunch just before I transferred money into my account to cover it I was penalized $210 for what amounted to a 15 minute technicality. The CSRs sent me away and told me to plead my case to the customer service number. At the 800-number I was eventually able to talk to “a manager” Jessica, who read me the verbiage that had appeared on customer statements about this change. So, indeed, the charges are apparently my fault. Thankfully, Jessica gave me a courtesy refund for 3 of them, which helps a little.
My complaint is about this new policy. It makes you just like every other bank. It is the reason I left Chase. I thought BoA was different! And I have recommended BoA to MANY of my artist friends because of that flexibility and that, until now, I have had nothing but wonderful experiences with your employees and with my account management.
Unfortunately, the remaining $105 that is now tied up in fees will ensure that my rent check this month bounces which means I will be charged more fees in addition to NSF fees from my rental company, and it is all I had budgeted for food for the first two weeks of this month. The good news is I just got a promotion at work which will, in another month, enable me to pick up and repay this set-back, sign up for automatic deposits, get money into my Savings account that might actually stay there and start to invest in some sort of stability for my future.
I’m just going to have to think long and hard about whether I want to continue doing all of those things with your bank.
Thank you for your time.
Jennifer
Ref:http://consumerist.com/5009230/polite-letter-gets-bank-of-america-to-refund-overdraft-fees
Subscribe to:
Posts (Atom)