/// <summary>
 /// Update a BGHandbookDetail1.
 /// </summary>
 public void Update(Model.BGHandbookDetail1 bGHandbookDetail1)
 {
     //
     // todo: add other logic here.
     //
     accessor.Update(bGHandbookDetail1);
 }
 /// <summary>
 /// Insert a BGHandbookDetail1.
 /// </summary>
 public void Insert(Model.BGHandbookDetail1 bGHandbookDetail1)
 {
     //
     // todo:add other logic here
     //
     accessor.Insert(bGHandbookDetail1);
 }
Beispiel #3
0
        public bool ExistsExcept(Model.BGHandbookDetail1 e)
        {
            Hashtable paras = new Hashtable();

            paras.Add("newId", e.Id);
            paras.Add("oldId", Get(e.BGHandbookDetail1Id) == null?null:Get(e.BGHandbookDetail1Id).Id);
            return(sqlmapper.QueryForObject <bool>("BGHandbookDetail1.existsexcept", paras));
        }
        /// <summary>
        /// 已定未出
        /// </summary>
        /// <param name="codetail"></param>
        /// <param name="quantity"></param>
        public void UpdateYDWC(Model.InvoiceXODetail xodetail, double quantity)// 已定未出
        {
            //detail1.UpQuantity = detail1.Quantity - beeQuantity;
            //Model.BGHandbookDetail1 detail1 = bindingSource1.Current as Model.BGHandbookDetail1;
            Model.BGHandbookDetail1 detail = accessor.SelectBGProduct(xodetail.HandbookId, xodetail.HandbookProductId);
            if (detail != null)
            {
                if (!detail.YdwcQuantity.HasValue)
                {
                    detail.YdwcQuantity = 0;
                }
                //if (!detail.BeeQuantity.HasValue) detail.BeeQuantity = 0;

                detail.YdwcQuantity = detail.YdwcQuantity + quantity;
                //detail.UpQuantity = detail.Quantity - detail.BeeQuantity;
                //detail.UpQuantity = detail.Quantity - detail.BeeQuantity - detail.YdwcQuantity;
                accessor.Update(detail);
            }
        }
        public void UpdateUpQuantity(Model.BGHandbookDetail1 detail)//剩余数量
        {
            //2014年12月15日开始出库单出货后“已出数量”增加,手册成品出货单出货后“已定已出”增加,现在反过来。
            double b = Convert.ToDouble(detail.LiLunHaoYongJingSun);

            detail.UpQuantity          = Convert.ToDouble(detail.Quantity) - Convert.ToDouble(detail.BeeQuantity);
            detail.LiLunHaoYongJing    = (double)GetSiSheWuRu(Convert.ToDecimal(detail.BeeQuantity) * Convert.ToDecimal(detail.LjingQuantity), 2);
            detail.LiLunHaoYongJingSun = (double)GetSiSheWuRu(Convert.ToDecimal(detail.BeeQuantity) * Convert.ToDecimal(detail.LjingQuantity) / (1 - Convert.ToDecimal(detail.Lsunhaolv) * 0.01M), 2);

            accessor.Update(detail);

            Model.BGHandbookDetail2 detail2 = Detail2Accessor.SelectBGProduct(detail.BGHandbook.Id, (detail.LId == null ? "" : detail.LId.ToString()));

            if (detail2 != null)
            {
                double a = Convert.ToDouble(detail2.LilunHaoYong) - b;

                detail2.LilunHaoYong = a + Convert.ToDouble(detail.LiLunHaoYongJingSun);
                detail2.LilunStock   = Convert.ToDouble(detail2.LbejinQuantity) - Convert.ToDouble(detail2.LilunHaoYong);
                Detail2Accessor.Update(detail2);
            }
        }
 public bool ExistsExcept(Model.BGHandbookDetail1 e)
 {
     return(accessor.ExistsExcept(e));
 }
Beispiel #7
0
 public void Update(Model.BGHandbookDetail1 e)
 {
     this.Update <Model.BGHandbookDetail1>(e);
 }
Beispiel #8
0
 public void Insert(Model.BGHandbookDetail1 e)
 {
     this.Insert <Model.BGHandbookDetail1>(e);
 }