public void LoadSupplier() { try { Session["PoRecmSupplier"] = BLLInvSupplier.GetSupplierList(null); if (Session["PoRecmSupplier"] != null) { ddlSupplier.DataSource = Session["PoRecmSupplier"]; ddlSupplier.DataTextField = "supplierName"; ddlSupplier.DataValueField = "supplierID"; ddlSupplier.DataBind(); ListItem a = new ListItem(); a.Selected = true; a.Text = "----छान्नुहोस----"; a.Value = "0"; ddlSupplier.Items.Insert(0, a); } } catch (Exception ex) { this.lblStatusMessageTitle.Text = "Error Status"; this.lblStatusMessage.Text = ex.Message; this.programmaticModalPopup.Show(); } }
void LoadSupplierList() { try { Session["supplier_list"] = BLLInvSupplier.GetSupplierList(null); this.lstSupplier.DataSource = (List <ATTInvSupplier>)Session["supplier_list"]; this.lstSupplier.DataTextField = "SupplierName"; this.lstSupplier.DataValueField = "SupplierID"; this.lstSupplier.DataBind(); } catch (Exception ex) { this.lblStatus.Text = ex.Message; } }
protected void btnSubmit_Click(object sender, EventArgs e) { if (this.txtSupplierName_Rqd.Text == "") { this.lblStatusMessage.Text = "Please enter supplier name."; this.programmaticModalPopup.Show(); this.lblStatus.Focus(); return; } ATTInvSupplier supplier = (ATTInvSupplier)Session["Supplier"]; supplier.SupplierName = txtSupplierName_Rqd.Text; supplier.PanNo = txtPanNo.Text; supplier.SupplierAddress = txtSupplierAddress.Text; supplier.Active = (chkSActive.Checked ? "Y" : "N"); supplier.EntryBy = ((ATTUserLogin)Session["Login_User_Detail"]).UserName; if (lstSupplier.SelectedIndex >= 0) { supplier.Action = "E"; } else { supplier.Action = "A"; } if (BLLInvSupplier.AddSupplier(supplier)) { this.lblStatusMessage.Text = "Information Saved"; this.programmaticModalPopup.Show(); } else { this.lblStatusMessage.Text = "Information could not be Saved"; this.programmaticModalPopup.Show(); } ClearSupplier(); }