private void LoadRecord() { Int32 iID = Convert.ToInt32(Common.Decrypt(Request.QueryString["id"],Session.SessionID)); Banks clsBank = new Banks(); BankDetails clsDetails = clsBank.Details(iID); clsBank.CommitAndDispose(); lblBankID.Text = clsDetails.BankID.ToString(); txtBankCode.Text = clsDetails.BankCode; txtBankName.Text = clsDetails.BankName; txtChequeCode.Text = clsDetails.ChequeCode; txtChequeCounter.Text = clsDetails.ChequeCounter; }
private void SaveRecord() { BankDetails clsDetails = new BankDetails(); clsDetails.BankID = Convert.ToInt32(lblBankID.Text); clsDetails.BankCode = txtBankCode.Text; clsDetails.BankName = txtBankName.Text; clsDetails.ChequeCode = txtChequeCode.Text; clsDetails.ChequeCounter = txtChequeCounter.Text; Banks clsBank = new Banks(); clsBank.Update(clsDetails); clsBank.CommitAndDispose(); }
private Int32 SaveRecord() { BankDetails clsDetails = new BankDetails(); clsDetails.BankCode = txtBankCode.Text; clsDetails.BankName = txtBankName.Text; clsDetails.ChequeCode = txtChequeCode.Text; clsDetails.ChequeCounter = txtChequeCounter.Text; Banks clsBank = new Banks(); Int32 id = clsBank.Insert(clsDetails); clsBank.CommitAndDispose(); return id; }
private bool Delete() { bool boRetValue = false; string stIDs = ""; foreach(DataListItem item in lstItem.Items) { HtmlInputCheckBox chkList = (HtmlInputCheckBox) item.FindControl("chkList"); if (chkList!=null) { if (chkList.Checked == true) { stIDs += chkList.Value + ","; boRetValue = true; } } } if (boRetValue) { Banks clsBank = new Banks(); clsBank.Delete( stIDs.Substring(0,stIDs.Length-1)); clsBank.CommitAndDispose(); } return boRetValue; }
private void LoadList() { Banks clsBank = new Banks(); string SortField = "BankID"; if (Request.QueryString["sortfield"]!=null) { SortField = Common.Decrypt(Request.QueryString["sortfield"].ToString(), Session.SessionID); } SortOption sortoption = SortOption.Ascending; if (Request.QueryString["sortoption"]!=null) { sortoption = (SortOption) Enum.Parse(typeof(SortOption), Common.Decrypt(Request.QueryString["sortoption"], Session.SessionID), true); } string SearchKey = ""; if (Request.QueryString["Search"]!=null) { SearchKey = Common.Decrypt((string)Request.QueryString["search"],Session.SessionID); } PageData.DataSource = clsBank.ListAsDataTable(SearchKey, SortField, sortoption).DefaultView; clsBank.CommitAndDispose(); int iPageSize = Convert.ToInt16(Session["PageSize"]) ; PageData.AllowPaging = true; PageData.PageSize = iPageSize; try { PageData.CurrentPageIndex = Convert.ToInt16(cboCurrentPage.SelectedItem.Value) - 1; lstItem.DataSource = PageData; lstItem.DataBind(); } catch { PageData.CurrentPageIndex = 1; lstItem.DataSource = PageData; lstItem.DataBind(); } cboCurrentPage.Items.Clear(); for (int i=0; i < PageData.PageCount;i++) { int iValue = i + 1; cboCurrentPage.Items.Add(new ListItem(iValue.ToString(),iValue.ToString())); if (PageData.CurrentPageIndex == i) { cboCurrentPage.Items[i].Selected = true;} else { cboCurrentPage.Items[i].Selected = false;} } lblDataCount.Text = " of " + " " + PageData.PageCount; }
private void LoadOptions() { DataClass clsDataClass = new DataClass(); Banks clsBank = new Banks(); cboBank.DataTextField = "BankCode"; cboBank.DataValueField = "BankID"; cboBank.DataSource = clsBank.ListAsDataTable().DefaultView; cboBank.DataBind(); clsBank.CommitAndDispose(); cboBank.SelectedIndex = 0; cboBank_SelectedIndexChanged(null, null); Contacts clsContact = new Contacts(); cboPayee.DataTextField = "ContactCode"; cboPayee.DataValueField = "ContactID"; cboPayee.DataSource = clsDataClass.DataReaderToDataTable(clsContact.Suppliers(null, 0, "ContactName", SortOption.Ascending)).DefaultView; cboPayee.DataBind(); clsContact.CommitAndDispose(); cboPayee.SelectedIndex = 0; txtChequeDate.Text = DateTime.Now.ToString("yyyy-MM-dd"); lblPaymentID.Text = "0"; lblTotalDebitAmount.Text = "0.00"; lblTotalCreditAmount.Text = "0.00"; lblTotalAmount.Text = "0.00"; txtPostingDate.Text = DateTime.Now.ToString("yyyy-MM-dd"); LoadAccount(); }
protected void cboBank_SelectedIndexChanged(object sender, EventArgs e) { int bankid = Convert.ToInt32(cboBank.SelectedItem.Value); Banks clsBank = new Banks(); txtChequeNo.Text = clsBank.getChequeNo(bankid); clsBank.CommitAndDispose(); }