Exemplo n.º 1
0
        /// <summary>
        /// 更新案件材料
        /// </summary>
        /// <param name="Sn"></param>
        /// <param name="Seq"></param>
        /// <returns></returns>
        public Boolean Update(Tvupart part)
        {
            using (TransactionScope scope = new TransactionScope())
            {
                #region 更新案件材料

                var con = new Conditions <DataBase.TVUPART>();


                con.And(x => x.Sn == part.Sn &&
                        x.Seq == part.Seq);

                con.Allow(x => x.Part_No);
                con.Allow(x => x.Qty);
                //con.Allow(x => x.Use_Date);
                con.Allow(x => x.Price);


                _tpartRepo.Update(con, part);

                #endregion

                decimal price = GetTotalPrice(part.Sn);

                RefillPrice(part.CompCd, part.Sn, price);


                scope.Complete();
            }
            return(true);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 新增案件材料
        /// </summary>
        /// <param name="Sn"></param>
        /// <param name="Seq"></param>
        /// <returns></returns>
        public Boolean Add(Tvupart part)
        {
            using (TransactionScope scope = new TransactionScope())
            {
                part.Seq = (byte)(GetMaxSeq(part.Sn) + 1);

                #region 新增案件材料

                var con = new Conditions <DataBase.TVUPART>();

                con.And(x => x.Sn == part.Sn &&
                        x.Seq == part.Seq);

                _tpartRepo.Add(con, part);

                #endregion


                decimal price = GetTotalPrice(part.Sn);


                RefillPrice(part.CompCd, part.Sn, price);


                scope.Complete();
            }
            return(true);
        }
 public UseMaterialResultApiViewModel(Tvupart data)
 {
     this.Unit      = data.Unit;
     this.Sn        = data.Sn;
     this.AssetCd   = data.AssetCd;
     this.CompCd    = data.CompCd;
     this.PartNo    = data.PartNo;
     this.PartSpec  = data.PartSpec;
     this.Price     = data.Price;
     this.Qty       = data.Qty;
     this.Seq       = data.Seq;
     this.StoreCd   = data.StoreCd;
     this.StoreName = data.StoreName;
     this.UseDate   = data.UseDate;
     this.PartName  = data.PartName;
 }
        public MaterialResultViewModel(Tvupart data)
        {
            this.Seq     = data.Seq.ToString();
            this.PartNo  = data.PartNo;
            this.Price   = data.Price;
            this.Qty     = data.Qty;
            this.Spec    = data.PartSpec;
            this.Unit    = data.Unit;
            this.UseDate = data.UseDate;
            this.PreCost = (data.Qty * data.Price);

            this.colData = new string[] {
                this.Seq,
                this.UseDate.ToString("yyyy/MM/dd"),
                this.PartNo,
                this.Spec,
                this.Unit,
                this.Qty.ToString(),
                this.Price.ToString(),
                this.PreCost.ToString()
            };
        }