Exemplo n.º 1
0
 public void Update(OutStoreModel ost)
 {
     var bizOst = GetBizModel(ost);
     _bizOutStore.Update(bizOst);
 }
Exemplo n.º 2
0
        public void OutStore(OutStoreModel outStoreModel)
        {
            if (!UIContext.SyncInstockToStockTask.IsCompleted)
            {
                UIContext.SyncInstockToStockTask.Wait();
            }

            var outStore = GetBizModel(outStoreModel);
            _outStoreService.OutStcok(outStore, UIContext.LoginUser.Account);
        }
Exemplo n.º 3
0
 public OutStoreModel GetEntityFromBiz(BizLayer.OutStore bizOst)
 {
     OutStoreModel ost = null;
     if (bizOst != null)
     {
         ost = new OutStoreModel();
         ost.Code = bizOst.Code;
         ost.Id = bizOst.Id;
         ost.InstoreId = bizOst.InstoreId;
         ost.Number = bizOst.Number;
         ost.Department = bizOst.Department;
         ost.UnitPrice = bizOst.UnitPrice;
         ost.TotalPrice = bizOst.TotalPrice;
         ost.Department = bizOst.Department;
         ost.Type = bizOst.Type;
         ost.CreatedBy = bizOst.CreatedBy;
         ost.CreatedDate = bizOst.CreatedDate;
         ost.UpdatedBy = bizOst.UpdatedBy;
         ost.UpdatedDate = bizOst.UpdatedDate;
     }
     return ost;
 }
Exemplo n.º 4
0
 public BizLayer.OutStore GetBizModel(OutStoreModel ost)
 {
     BizLayer.OutStore bizOst = null;
     if (ost != null)
     {
         bizOst = new BizLayer.OutStore();
         bizOst.Code = ost.Code;
         bizOst.Id = ost.Id;
         bizOst.Number = ost.Number;
         bizOst.UnitPrice = ost.UnitPrice;
         bizOst.TotalPrice = ost.TotalPrice;
         bizOst.Department = ost.Department;
         bizOst.InstoreId = ost.InstoreId;
         bizOst.Type = ost.Type;
         bizOst.CreatedBy = ost.CreatedBy;
         bizOst.CreatedDate = ost.CreatedDate;
         bizOst.UpdatedBy = ost.UpdatedBy;
         bizOst.UpdatedDate = ost.UpdatedDate;
     }
     return bizOst;
 }
Exemplo n.º 5
0
 public void Create(OutStoreModel ost)
 {
     var dbDpt = GetBizModel(ost);
     _bizOutStore.Create(dbDpt);
 }
Exemplo n.º 6
0
        private void btnStoreOut(DataGridView grd)
        {
            var isSaveOk = false;
            if (grd.Rows != null && grd.Rows.Count > 0)
            {
                foreach (var row in grd.Rows)
                {
                    var grdRow = row as DataGridViewRow;
                    if (grdRow.Cells[4].Value != null)
                    {
                        var code = grdRow.Cells[1].Value.ToString();
                        var remainNumber = Int32.Parse(grdRow.Cells[3].Value.ToString());
                        var outNumber = Int32.Parse(grdRow.Cells[4].Value.ToString());
                        var inStoreId = grdRow.Cells[9].Value.ToString();
                        var unitStoreIds = grdRow.Cells[10].Value != null ? grdRow.Cells[10].Value.ToString() : "";
                        if (outNumber > 0)
                        {
                            decimal unitPrice = 0.00M;
                            decimal totalPrice = 0.00M;
                            if (grdRow.Cells[5].Value != null)
                            {
                                unitPrice = decimal.Parse(grdRow.Cells[5].Value.ToString());
                                totalPrice = outNumber * unitPrice;
                            }

                            OutStoreModel outStoreModel = new OutStoreModel();
                            outStoreModel.Id = Guid.NewGuid().ToString();
                            outStoreModel.Code = code;
                            outStoreModel.Department = this.cboZKPZDpts.SelectedValue.ToString();
                            outStoreModel.Number = outNumber;
                            outStoreModel.UnitPrice = unitPrice;
                            outStoreModel.TotalPrice = totalPrice;
                            outStoreModel.Type = grd.Tag.ToString();
                            outStoreModel.InstoreId = inStoreId;
                            outStoreModel.CreatedBy = UIContext.LoginUser.Account;
                            outStoreModel.CreatedDate = DateTime.Now;
                            outStoreModel.UpdatedBy = UIContext.LoginUser.Account;
                            outStoreModel.UpdatedDate = DateTime.Now;
                            _outStoreModel.OutStore(outStoreModel);

                            isSaveOk = true;
                        }
                    }
                }

            }
            if (isSaveOk)
            {
                btnQueryStoreDetails_Click(null, null);
            }
        }