private void BindReciptTypes() { try { BAReceiptType objRecieptType = new BAReceiptType(); int reciptType = 0; ddldpstReceiptType.Items.Clear(); DataSet ObjDsClients = objRecieptType.GetReceiptType(reciptType); if (ObjDsClients.Tables[0].Rows.Count > 0) { ddldpstReceiptType.DataSource = ObjDsClients; ddldpstReceiptType.DataValueField = "ReceiptId"; ddldpstReceiptType.DataTextField = "RecDescription"; ddldpstReceiptType.DataBind(); ddldpstReceiptType.Items.Insert(0, new ListItem("Select Receipt Type", "0")); } else { ddldpstReceiptType.Items.Insert(0, new ListItem("Select Receipt Type", "0")); } } catch (Exception ex) { lblMsg.Text = _objBOUtiltiy.ShowMessage("danger", "error", ex.Message); ExceptionLogging.SendExcepToDB(ex); } }
private void BindReceiptType() { try { gvReceiptList.PageSize = int.Parse(ViewState["ps"].ToString()); int ReceiptId = 0; DataSet ds = objBAReceipt.GetReceiptType(ReceiptId); Session["dt"] = ds.Tables[0]; if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { gvReceiptList.DataSource = ds.Tables[0]; string sortDirection = "ASC", sortExpression; if (ViewState["so"] != null) { sortDirection = ViewState["so"].ToString(); } if (ViewState["se"] != null) { sortExpression = ViewState["se"].ToString(); ds.Tables[0].DefaultView.Sort = sortExpression + " " + sortDirection; } gvReceiptList.DataBind(); } else { gvReceiptList.DataSource = null; gvReceiptList.DataBind(); Label lblEmptyMessage = gvReceiptList.Controls[0].Controls[0].FindControl("lblEmptyMessage") as Label; lblEmptyMessage.Text = "Currently there are no records in System"; } } catch (Exception ex) { lblMsg.Text = _BOUtility.ShowMessage("danger", "Danger", ex.Message); ExceptionLogging.SendExcepToDB(ex); } }
private void GetReceiptTypes(int ReceiptId) { try { DataSet ds = objBAReceipt.GetReceiptType(ReceiptId); if (ds.Tables[0].Rows.Count > 0) { hf_ReceiptTypeId.Value = ds.Tables[0].Rows[0]["ReceiptId"].ToString(); txtReceiptKey.Text = ds.Tables[0].Rows[0]["ReceiptKey"].ToString(); txtReceiptKey.Enabled = false; txtDescription.Text = ds.Tables[0].Rows[0]["RecDescription"].ToString(); chkDeactivate.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["Deactivate"]); dropBankAccount.SelectedIndex = dropBankAccount.Items.IndexOf(dropBankAccount.Items.FindByValue(ds.Tables[0].Rows[0]["BankAccount"].ToString())); dropDepMethod.SelectedIndex = dropDepMethod.Items.IndexOf(dropDepMethod.Items.FindByValue(ds.Tables[0].Rows[0]["DepListMethod"].ToString())); dropCreditType.SelectedIndex = dropCreditType.Items.IndexOf(dropCreditType.Items.FindByValue(ds.Tables[0].Rows[0]["CreditCardType"].ToString())); ChkDefaultReciepts.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["NewReceipt"]); } } catch (Exception ex) { lblMsg.Text = _BOUtility.ShowMessage("danger", "Danger", ex.Message); ExceptionLogging.SendExcepToDB(ex); } }