private void Delete() { ProductDim oDim = ProductDim.Load(this.CombinId); if (oDim != null) { DeleteDetails(oDim.DimensionId); oDim.Delete(); } }
private void LoadCombinationList() { ProductDim oDim = ProductDim.Load(this.CombinId); if (oDim != null) { txtCombinNumber.Text = oDim.DimCode; } BindAppendixList(); }
private bool Save() { if (!Verify()) { return(false); } ProductDim oDim = ProductDim.Load(this.CombinId); if (oDim == null) { oDim = new ProductDim(); oDim.DimCode = txtCombinNumber.Text; switch (this.FormType) { case FormLayoutType.Appendix1: oDim.DimType = "A1"; break; case FormLayoutType.Appendix2: oDim.DimType = "A2"; break; case FormLayoutType.Appendix3: oDim.DimType = "A3"; break; case FormLayoutType.All: default: oDim.DimType = ""; break; } oDim.CreatedBy = DAL.Common.Config.CurrentUserId; oDim.CreatedOn = DateTime.Now; } oDim.ModifiedBy = DAL.Common.Config.CurrentUserId; oDim.ModifiedOn = DateTime.Now; oDim.Save(); this.CombinId = oDim.DimensionId; SaveDetails(oDim.DimensionId); return(this.CombinId != System.Guid.Empty); }
private void FillCombinList() { cboCombinationNum.DataSource = null; //cboCombinationNum.Items.Clear(); string[] orderBy = new string[] { "DimCode" }; ProductDimCollection oDimList = ProductDim.LoadCollection(orderBy, true); // ---------------------------------------------------------------------------------------------------- // 2008-05-29 Carrie : Bug #337 // Avoid loading incorrect Combination List for EMPTY Combin#, it changes to insert EMPTY record at the top of list. // ---------------------------------------------------------------------------------------------------- // Inset New EMPTY record oDimList.Insert(0, new ProductDim()); cboCombinationNum.DataSource = oDimList; cboCombinationNum.DisplayMember = "DimCode"; cboCombinationNum.ValueMember = "DimensionId"; // ---------------------------------------------------------------------------------------------------- // 2008-05-29 Carrie : EMPTY record has been inserted into the top so that the default "SelectedIndex" set to be 0. // ---------------------------------------------------------------------------------------------------- cboCombinationNum.SelectedIndex = 0; }