예제 #1
0
        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);
        }
예제 #2
0
        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;
            }
        }
예제 #3
0
 public override int GetNewPartNumber()
 {
     return((short)EstItemCommon.GetNewPartNumber(NewEstItem.EstRevID, NewEstItem.SerialID));
 }
예제 #4
0
 public override short GetNewOption()
 {
     return((short)EstItemCommon.GetNewOption(NewEstItem.EstRevID, NewEstItem.EstItemNo));
 }
예제 #5
0
 public override short GetNewItemNumber()
 {
     return((short)EstItemCommon.GetNewNumber(NewEstItem.EstRevID));
 }
예제 #6
0
 public override int GetNewSerialID()
 {
     return(EstItemCommon.GetNewSerialID(NewEstItem.EstRevID));
 }