public void DeleteArmorPlate2Item(ArmorPlate2Item armorPlate2Item) { this._helper.DeleteDomainObject(armorPlate2Item); }
private object GetEditObject() { if (this.ValidateInput()) { if (_apFacade == null) { _apFacade = new SMTFacadeFactory(base.DataProvider).CreateArmorPlateFacade(); } ArmorPlate obj = this._apFacade.CreateNewArmorPlate(); obj.ArmorPlateID = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtAPIDEdit.Text, 40)); obj.BasePlateCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtBPCodeEdit.Text, 40)); obj.Version = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtVersionEdit.Text, 40)); obj.Thickness = Convert.ToDecimal(FormatHelper.CleanString(this.txtThicknessEdit.Text)); obj.ManufacturerSN = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtManSNEdit.Text, 40)); obj.LBRate = Convert.ToInt32(FormatHelper.CleanString(this.txtLBRateEdit.Text)); obj.TensionA = Convert.ToDecimal(FormatHelper.CleanString(this.txtTenAEdit.Text)); obj.TensionB = Convert.ToDecimal(FormatHelper.CleanString(this.txtTenBEdit.Text)); obj.TensionC = Convert.ToDecimal(FormatHelper.CleanString(this.txtTenCEdit.Text)); obj.TensionD = Convert.ToDecimal(FormatHelper.CleanString(this.txtTenDEdit.Text)); obj.TensionE = Convert.ToDecimal(FormatHelper.CleanString(this.txtTenEEdit.Text)); obj.InFactoryDate = FormatHelper.TODateInt(this.txtInFacDate.Text); obj.InFactoryTime = FormatHelper.TOTimeInt(this.txtInFacTime.Text); obj.Memo = FormatHelper.CleanString(this.txtMemoEdit.Text, 100); obj.UsedTimes = 0; obj.Status = ArmorPlateStatus.StartUsing; obj.MaintainUser = this.GetUserCode(); string[] items = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtItemEdit.Text)).Split(','); if (items != null && items.Length > 0) { //-------Modify by DS22 / Crane.Liu 2014-02-27 Start-------------- /// Description: /// 新增钢板,选择多个产品;维护后保存,再查看该钢板,发现对应产品只有选择多个产品的第一个和最后一个; /// 保存时有一段过滤重复产品的逻辑,不正确,导致只能得到头尾两个产品 /// List <string> itemList = new List <string>(items); ItemFacade itemFacade = new SMTFacadeFactory(base.DataProvider).CreateItemFacade(); ArmorPlate2Item[] ap2Items = new ArmorPlate2Item[itemList.Count]; int i = 0; foreach (string itemstr in itemList) { ArmorPlate2Item ap2Item = this._apFacade.CreateNewArmorPlate2Item(); ap2Item.ArmorPlateID = obj.ArmorPlateID; ap2Item.ItemCode = itemstr.ToString(); ap2Item.MaintainUser = this.GetUserCode(); object item = itemFacade.GetItem(ap2Item.ItemCode, GlobalVariables.CurrentOrganizations.First().OrganizationID); ap2Items[i++] = ap2Item; } //-------Modify by DS22 / Crane.Liu 2014-02-27 End---------------- obj.Items = ap2Items; } return(obj); } else { return(null); } }
public void AddArmorPlate2Item(ArmorPlate2Item armorPlate2Item) { this._helper.AddDomainObject(armorPlate2Item); }