private void Init(BilliingVO bill) { List <OrderGoodsVO> list = null; if (bill.Direct == PYMNT_DIRECT.PAY) { list = supplierManager.LoadOrderGoods((int)bill.CustID, bill._OrderNOList, null); } else if (bill.Direct == PYMNT_DIRECT.RECEIVE) { list = resellerManager.LoadOrderGoods((int)bill.CustID, bill._OrderNOList, null); } foreach (OrderGoodsVO goods in list) { int index = dtgvOrderGoods.Rows.Add(); dtgvOrderGoods.Rows[index].Cells[colOrderNO.Name].Value = goods.OrderNO; dtgvOrderGoods.Rows[index].Cells[colDirectDesc.Name].Value = DIRECT.DIRECT_MAP[goods.Direct]; dtgvOrderGoods.Rows[index].Cells[colGID.Name].Value = goods.GID; dtgvOrderGoods.Rows[index].Cells[colGName.Name].Value = goods.GName; dtgvOrderGoods.Rows[index].Cells[colSpesc.Name].Value = goods.Specs; dtgvOrderGoods.Rows[index].Cells[colNum.Name].Value = goods.Num; dtgvOrderGoods.Rows[index].Cells[colPrice.Name].Value = goods.Price; dtgvOrderGoods.Rows[index].Cells[colCrtTmst.Name].Value = goods.Tmst; dtgvOrderGoods.Rows[index].Cells[colAmount.Name].Value = goods.Num * goods.Price; } }
public BillGoodsVO LoadBillGoods(string billNO, int supplierId, PageVO page) { BillGoodsVO billGoods = null; if (StringUtil.isEmpty(billNO)) { return(billGoods); } BilliingVO billVO = service.LoadBill(billNO, supplierId, page); if (null != billVO) { billGoods = new BillGoodsVO(); billGoods.BillNO__PK = billVO.BillNO__PK; billGoods.Amount = billVO.Amount; billGoods.CrtTmst = billVO.CrtTmst; billGoods.CrtUsrId = billVO.CrtUsrId; billGoods.CustID = billVO.CustID; billGoods.CustName = billVO.CustName; billGoods.Direct = billVO.Direct; billGoods.FactAmount = billVO.FactAmount; List <OrderGoodsVO> orderGoodsList = orderService.LoadSupplierOrderGoods(supplierId, billVO._OrderNOList, page); billGoods._OrderGoods = orderGoodsList; } return(billGoods); }
public string Entry(BilliingVO vo) { string billNO = string.Empty; DateTime now = DateTime.Now; billNO = GenBillNO(string.Format("{0:yyyyMMdd}", now), vo.Direct); if (StringUtil.isEmpty(billNO)) { return(billNO); } foreach (string orderNO in vo._OrderNOList) { BillingInfo binfo = new BillingInfo(); binfo.BillNO = billNO; binfo.OrderNO = orderNO; Connector.Save <BillingInfo>(binfo); Order order = new Order(); order.OrderNO__PK = orderNO; order.Handled = HANDLE_FLAG.HANDLED; Connector.Update <Order>(order); } Billing bill = new Billing(); bill.Amount = vo.Amount; bill.BillNO__PK = billNO; bill.CrtTmst = now; bill.CrtUsrId = vo.CrtUsrId; bill.CustID = vo.CustID; bill.CustName = vo.CustName; bill.Direct = vo.Direct; bill.FactAmount = 0; Connector.Save <Billing>(bill); return(billNO); }
public string Entry(BilliingVO vo) { if (null == vo || null == vo._OrderNOList || vo._OrderNOList.Count < 1) { return(string.Empty); } vo.Direct = PYMNT_DIRECT.PAY; return(service.Entry(vo)); }
private void btnEntry_Click(object sender, EventArgs e) { List <string> list = new List <string>(selectedOrdrMap.Keys); decimal total = 0; foreach (decimal amount in selectedOrdrMap.Values) { total += amount; } if (list.Count > 0) { if (cboxQrdSupplier.SelectedIndex == -1) { return; } Customer supplier = cboxQrdSupplier.SelectedItem as Customer; BilliingVO vo = new BilliingVO(); vo._OrderNOList = list; vo.Amount = total; vo.CrtUsrId = MainForm.usr.UId__PK; vo.CustID = (int)supplier.CID__PK; vo.CustName = supplier.CName; vo.Direct = PYMNT_DIRECT.PAY; BillCnfrmDialog cnfrmDiaglog = new BillCnfrmDialog(vo, billingManager); DialogResult rslt = cnfrmDiaglog.ShowDialog(); if (rslt == DialogResult.OK) { string billNO = billingManager.Entry(vo); if (!StringUtil.isEmpty(billNO)) { MessageBox.Show("所选订单已入账! 账单号:" + billNO, "操作结果", MessageBoxButtons.OK, MessageBoxIcon.Information); dtgvOrders.Rows.Clear(); } else { MessageBox.Show("入账失败!", "操作结果", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } } }
public BillCnfrmDialog(BilliingVO bill, object manager) { InitializeComponent(); dtgvOrderGoods.AutoGenerateColumns = false; Text = "【账单】 " + bill.CustName; if (bill.Direct == PYMNT_DIRECT.PAY) { lblTotalTxt.Text = "总计应付(元):"; this.supplierManager = (ISupplierBillingManager)manager; } else if (bill.Direct == PYMNT_DIRECT.RECEIVE) { lblTotalTxt.Text = "总计应收(元):"; this.resellerManager = (IResellerBillingManager)manager; } else { return; } lblTotal.Text = bill.Amount + ""; Init(bill); }