public void datawithminats() { TextboxExample.Text = ""; DropDownExTextboxExample.Items.Clear(); DropDownExTextboxExample1.Items.Clear(); BILLDAL bal = new BILLDAL(); DataTable dt = bal.tariff_dataFill(ddltariff.SelectedItem.ToString()); DataRow[] dtt_rif = dt.Select("CHARGESTYPE ='DATA PAY PER USE' "); foreach (var item in dtt_rif) { DropDownExTextboxExample1.Items.Add(item["A"].ToString()); DropDownExTextboxExample.Items.Add(item["VALUE"].ToString()); TextboxExample.Text = item["VALUE"].ToString(); } DataRow[] dr_l1 = dt.Select("CHARGESTYPE = 'RENTAL'", ""); if (dr_l1.Length > 0) { System.Web.HttpContext.Current.Session["rntl"] = dr_l1[0]["VALUE"].ToString(); } else System.Web.HttpContext.Current.Session["rntl"] = 0; DataRow[] dr_lfree = dt.Select("CHARGESTYPE = 'FREE VALUE'", ""); if (dr_lfree.Length > 0) { System.Web.HttpContext.Current.Session["Free_Value"] = dr_lfree[0]["VALUE"].ToString(); } else System.Web.HttpContext.Current.Session["Free_Value"] = 0; //==================================================================== Bolton==================== DataRow[] dr_l18 = dt.Select("CHARGESTYPE = 'BOLTONS'", ""); if (dr_l1.Length > 0) { System.Web.HttpContext.Current.Session["rntl8"] = dr_l18[0]["VALUE"].ToString(); } else System.Web.HttpContext.Current.Session["rntl8"] = 0; //=============================================================================End }
public void TARIFFPRINT(string tariffcode) { Add_Tariffcls ads = new Add_Tariffcls(); BILLDAL bdl = new BILLDAL(); System.Data.DataTable dt = bdl.tariff_dataFill(tariffcode); ads.TARIFFCODE = dt.Rows[0]["TARIFF_CODE"].ToString(); ads.COUNTRY = dt.Rows[0]["country"].ToString(); DataRow[] drowrental = dt.Select("chargestype = 'RENTAL'", ""); foreach (var item in drowrental) { ads.RENTAL = (item["CURRENCY"].ToString() == "?" ? "INR" : item["CURRENCY"].ToString()) + " " + item["value"].ToString(); } DataRow[] drowvalidity = dt.Select("chargestype = 'VALIDITY'", ""); foreach (var item in drowvalidity) { ads.VALIDITY = item["value"] + " " + "DAYS"; } DataRow[] drowfreeval = dt.Select("chargestype = 'FREE VALUE'", ""); foreach (var item in drowfreeval) { ads.FREEVALUE = (item["CURRENCY"].ToString() == "?" ? "INR" : item["CURRENCY"].ToString()) + " " + item["value"].ToString(); } DataRow[] drowincoming = dt.Select("chargestype = 'INCOMING CALL'", ""); foreach (var item in drowincoming) { ads.INCOMING = (item["CURRENCY"].ToString() == "?" ? "INR" : item["CURRENCY"].ToString()) + " " + item["value"].ToString(); } DataRow[] drowlocaloutgoing = dt.Select("chargestype = 'LOCAL OUTGOING CALL'", ""); foreach (var item in drowlocaloutgoing) { ads.LOCALOUTGOING = (item["CURRENCY"].ToString() == "?" ? "INR" : item["CURRENCY"].ToString()) + " " + item["value"].ToString(); ads.CURRENCY = item["CURRENCY"].ToString() == "?" ? "INR" : item["CURRENCY"].ToString(); } DataRow[] drowintcallindia = dt.Select("chargestype = 'INDIA OUTGOING CALL'", ""); foreach (var item in drowintcallindia) { ads.INTCALL = (item["CURRENCY"].ToString() == "?" ? "INR" : item["CURRENCY"].ToString()) + " " + item["value"].ToString(); } DataRow[] drowlocalsms = dt.Select("chargestype = 'LOCAL SMS'", ""); foreach (var item in drowlocalsms) { ads.LOCALSMS = (item["CURRENCY"].ToString() == "?" ? "INR" : item["CURRENCY"].ToString()) + " " + item["value"].ToString(); } DataRow[] drowintsms = dt.Select("chargestype = 'INTL SMS'", ""); foreach (var item in drowintsms) { // ads.INTSMS = item["value"].ToString(); ads.INTSMS = (item["CURRENCY"].ToString() == "?" ? "INR" : item["CURRENCY"].ToString()) + " " + item["value"].ToString(); } DataRow[] drowcug = dt.Select("chargestype = 'CUG CALLING'", ""); foreach (var item in drowcug) { // ads.CUG = item["value"].ToString(); ads.CUG = (item["CURRENCY"].ToString() == "?" ? "INR" : item["CURRENCY"].ToString()) + " " + item["value"].ToString(); } DataRow[] drowdatause = dt.Select("chargestype = 'DATA PAY PER USE'", ""); foreach (var item in drowdatause) { // ads.DATAPER = item["A"].ToString(); ads.DATAPER = (item["CURRENCY"].ToString() == "?" ? "INR" : item["CURRENCY"].ToString()) + " " + item["value"].ToString(); } DataRow[] drowboltans = dt.Select("chargestype = 'BOLTONS'", ""); foreach (var item in drowboltans) { ads.Add(new ADD_TARIFFCLS1 { DATANAME = item["A"].ToString(), DATAVALIDITY = item["Validity_Days"].ToString(), DATAUSE = (item["CURRENCY"].ToString() == "?" ? "INR" : item["CURRENCY"].ToString()) + " " + item["value"].ToString() }); } System.Web.HttpContext.Current.Session["dexcel"] = ads; }