protected void btnProduct_Click(object sender, EventArgs e) { try { if ((this.lblErrorMessage.Text.Length != 0) || (this.lblSuccessMessage.Text.Length != 0)) { this.lblSuccessMessage.Text = ""; this.lblErrorMessage.Text = ""; } if (this.ddlProductName.SelectedValue == "") { return; } ProductInfoDTO oProductInfoDTO = new ProductInfoDTO(); Facade facade = Facade.GetInstance(); if (this.ddlProductName.SelectedValue != "") { oProductInfoDTO = ProductInfoBLImp.LoadProductInfoDTO((Guid)TypeDescriptor.GetConverter(oProductInfoDTO.PrimaryKey).ConvertFromString(this.ddlProductName.SelectedValue)); this.txtOpeningQty.Text = "1"; this.txtOpeningRate.Text = oProductInfoDTO.P_CostPrice.ToString("####.##"); this.txtOpeningDiscount.Text = oProductInfoDTO.P_Discount.ToString("####.##"); this.hfProductCode.Value = oProductInfoDTO.P_Code; this.HiddenField1.Value = oProductInfoDTO.PrimaryKey.ToString(); } } catch (Exception exp) { lblErrorMessage.Text = cls.ErrorString(exp); } finally { ScriptManager1.SetFocus(txtOpeningDate); } }
public ProductInfoDTO GetProductInfoDTO(Guid pk) { return(ProductInfoBLImp.LoadProductInfoDTO(pk)); }