private long CreateNewEstItem(string productName) { try { var item = new EST_Item() { EstRevID = _estRevID, SerialID = EstItemCommon.GetNewSerialID(_estRevID), EstItemNo = (short)EstItemCommon.GetNewNumber(_estRevID), ProductID = _product.ProductID, ProductName = productName, StatusID = (int)NEstItemStatus.New, EstPart = 1, ItemOption = 1, IsFinalOption = true, Qty = 1, RequirementID = (int)NWorkorderRequirement.Installation, PositionID = 10, IsTemplateApplicable = true, SizeRows = _template.SizeTotalRows, EstimatorPrice = 0, PriceA = 0, PriceB = 0, PriceExtra = 0, }; //Create New EstItem _db.EST_Item.Add(item); _db.SaveChanges(); return(item.EstItemID); } catch (DbEntityValidationException dbEx) { var s = dbEx.Message; throw; } }
public override short GetNewItemNumber() { return((short)EstItemCommon.GetNewNumber(NewEstItem.EstRevID)); }