private void DropDownListSupplier(Facade facade) { ISupplierInfoBL SupplierInfoList = facade.createSupplierBL(); List <SupplierInfoDTO> oSupplierInfoList = SupplierInfoList.showDataSupplierInfo(); int i = 0; DDLSupplierName.Items.Clear(); DDLSupplierName.Items.Add("(Select Supplier Name)"); this.DDLSupplierName.Items[i].Value = "00000000-0000-0000-0000-000000000000"; foreach (SupplierInfoDTO newDto in oSupplierInfoList) { i++; this.DDLSupplierName.Items.Add(newDto.SupplierName); this.DDLSupplierName.Items[i].Value = newDto.PrimaryKey.ToString(); } }
protected void btnSave_Click(object sender, EventArgs e) { try { if (this.lblErrorMessage.Text.Length != 0) { this.lblErrorMessage.Text = ""; } SupplierInfoDTO dto = populate(); Facade facade = Facade.GetInstance(); ISupplierInfoBL oISupplierInfoBL = facade.createSupplierBL(); oISupplierInfoBL.addNewSupplierRecord(dto); this.lblErrorMessage.Text = "Data Save Successfully."; this.txtHideFieldPK.Value = ""; this.txtSupplierCode.Text = ""; this.txtSupplierName.Text = ""; this.txtShortName.Text = ""; this.txtPhone.Text = ""; this.txtFax.Text = ""; this.txtEmail.Text = ""; this.txtContractPerson.Text = ""; this.txtAddress.Text = ""; this.txtWebAddress.Text = ""; this.btnSave.Text = "Save"; this.GridView1.DataBind(); } catch (Exception Exp) { lblErrorMessage.Text = cls.ErrorString(Exp); } }