public static List <MyLongKeyValuePair> GetEstimationItemList(int estRevID) { var list = new List <MyLongKeyValuePair>(); DataTable tbl = EstItemCommon.GetEstimationItems(estRevID); if (tbl == null) { return(list); } foreach (DataRow row in tbl.Rows) { var vp = new MyLongKeyValuePair(); vp.Key = Convert.ToInt64(row["estItemID"]); vp.Value = "Item " + row["estItemNo"] + " - Option " + row["ItemOption"] + " - " + row["ProductName"]; list.Add(vp); } return(list); }
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 int GetNewPartNumber() { return((short)EstItemCommon.GetNewPartNumber(NewEstItem.EstRevID, NewEstItem.SerialID)); }
public override short GetNewOption() { return((short)EstItemCommon.GetNewOption(NewEstItem.EstRevID, NewEstItem.EstItemNo)); }
public override short GetNewItemNumber() { return((short)EstItemCommon.GetNewNumber(NewEstItem.EstRevID)); }
public override int GetNewSerialID() { return(EstItemCommon.GetNewSerialID(NewEstItem.EstRevID)); }