protected override void ShowItemInGridViewRow(DataGridViewRow row, object item) { CustomerPayment info = item as CustomerPayment; row.Tag = info; row.Cells["colID"].Value = info.ID; row.Cells["colSheetDate"].Value = info.SheetDate.ToString("yyyy-MM-dd"); CompanyInfo customer = customerTree1.GetCustomer(info.CustomerID); row.Cells["colCustomer"].Value = customer != null ? customer.Name : info.CustomerID; row.Cells["colPaymentMode"].Value = PaymentModeDescription.GetDescription(info.PaymentMode); row.Cells["colAmount"].Value = info.Amount.Trim(); row.Cells["colAssigned"].Value = info.Assigned.Trim(); row.Cells["colRemain"].Value = info.Remain.Trim(); row.Cells["colCheckNum"].Value = info.CheckNum; row.Cells["colState"].Value = SheetStateDescription.GetDescription(info.State); row.Cells["colMemo"].Value = info.Memo; if (info.State == SheetState.Canceled) { row.DefaultCellStyle.ForeColor = Color.Red; row.DefaultCellStyle.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Strikeout, System.Drawing.GraphicsUnit.Point, ((byte)(134))); } if (!_Sheets.Exists(it => it.ID == info.ID)) { _Sheets.Add(info); } }
protected override void ShowItemInGridViewRow(DataGridViewRow row, object item) { OrderItemRecord info = item as OrderItemRecord; row.Tag = info; row.Cells["colOrderID"].Value = info.SheetNo; row.Cells["colCustomer"].Value = info.Customer.Name; row.Cells["colProduct"].Value = info.Product != null ? info.Product.Name : info.ProductID; row.Cells["colUnit"].Value = info.Unit; row.Cells["colSales"].Value = info.SalesPerson; row.Cells["colDemandDate"].Value = info.DemandDate; row.Cells["colCount"].Value = info.Count.Trim(); row.Cells["colState"].Value = row.Cells["colState"].Value = SheetStateDescription.GetDescription(info.State); row.Cells["colOnWay"].Value = info.OnWay.Trim(); row.Cells["colInventory"].Value = info.Inventory.Trim(); row.Cells["colShipped"].Value = info.Shipped.Trim(); row.Cells["colNotPurchased"].Value = info.NotPurchased.Trim(); //当订单的已出货加备货数小于订单数时才提示产品的有效库存,这么做也是减少垃圾信息,方便用户准确找到信息 if ((info.Inventory + info.Shipped < info.Count) && _Inventories != null && _Inventories.Count > 0) { row.Cells["colValidInventory"].Value = _Inventories.Sum(it => it.ProductID == info.ProductID ? it.Valid : 0).Trim(); } row.Cells["colMemo"].Value = info.Memo; if (info.State == SheetState.Canceled) { row.DefaultCellStyle.ForeColor = Color.Red; row.DefaultCellStyle.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Strikeout, System.Drawing.GraphicsUnit.Point, ((byte)(134))); } if (!_Records.Exists(it => it.ID == info.ID)) { _Records.Add(info); } }
protected override void ShowItemInGridViewRow(DataGridViewRow row, object item) { Order info = item as Order; row.Cells["colID"].Value = info.ID; row.Cells["colSheetDate"].Value = info.SheetDate; CompanyInfo customer = customerTree1.GetCustomer(info.CustomerID); row.Cells["colCustomer"].Value = customer != null ? customer.Name : info.CustomerID; row.Cells["colSales"].Value = info.SalesPerson; row.Cells["colDeliveryDate"].Value = info.DemandDate; row.Cells["colWithTax"].Value = info.WithTax; row.Cells["colAmount"].Value = info.CalAmount().Trim(); row.Cells["colState"].Value = row.Cells["colState"].Value = SheetStateDescription.GetDescription(info.State); //row.Cells["colReceivable"].Value = order.Receivable.Trim(); //row.Cells["colHasPaid"].Value = order.HasPaid.Trim(); //row.Cells["colNotPaid"].Value = (order.CalAmount() - order.HasPaid).Trim(); row.Cells["colMemo"].Value = info.Memo; if (info.State == SheetState.Canceled) { row.DefaultCellStyle.ForeColor = Color.Red; row.DefaultCellStyle.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Strikeout, System.Drawing.GraphicsUnit.Point, ((byte)(134))); } if (!_Sheets.Exists(it => it.ID == info.ID)) { _Sheets.Add(info); } }
protected override void ShowItemInGridViewRow(DataGridViewRow row, object item) { StackOutSheet sheet = item as StackOutSheet; row.Tag = sheet; row.Cells["colSheetNo"].Value = sheet.ID; row.Cells["colClass"].Value = sheet.DocumentType; CompanyInfo customer = customerTree1.GetCustomer(sheet.CustomerID); row.Cells["colCustomer"].Value = customer != null ? customer.Name : string.Empty; WareHouse ws = (_Warehouses != null && _Warehouses.Count > 0) ? _Warehouses.SingleOrDefault(it => it.ID == sheet.WareHouseID) : null; row.Cells["colWareHouse"].Value = ws != null ? ws.Name : string.Empty; row.Cells["colState"].Value = SheetStateDescription.GetDescription(sheet.State); row.Cells["colShipDate"].Value = sheet.State == SheetState.Shipped ? sheet.LastActiveDate.ToString("yyyy-MM-dd") : null; row.Cells["colLinker"].Value = sheet.Linker; row.Cells["colTelphone"].Value = sheet.LinkerPhoneCall; row.Cells["colAddress"].Value = sheet.Address; row.Cells["colMemo"].Value = sheet.Memo; if (sheet.State == SheetState.Canceled) { row.DefaultCellStyle.ForeColor = Color.Red; row.DefaultCellStyle.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Strikeout, System.Drawing.GraphicsUnit.Point, ((byte)(134))); } if (!_Sheets.Exists(it => it.ID == sheet.ID)) { _Sheets.Add(sheet); } }
protected override void ShowItemInGridViewRow(DataGridViewRow row, object item) { CustomerOtherReceivable info = item as CustomerOtherReceivable; row.Cells["colID"].Value = info.ID; row.Cells["colSheetDate"].Value = info.SheetDate.ToString("yyyy-MM-dd"); CompanyInfo customer = customerTree1.GetCustomer(info.CustomerID); row.Cells["colCustomer"].Value = customer != null ? customer.Name : info.CustomerID; row.Cells["colCurrencyType"].Value = info.CurrencyType; row.Cells["colAmount"].Value = info.Amount.Trim(); CustomerReceivable cr = _Receivables.SingleOrDefault(it => it.SheetID == info.ID); if (cr != null) { row.Cells["colPaid"].Value = cr.Haspaid.Trim(); row.Cells["colNotPaid"].Value = cr.Remain.Trim(); } row.Cells["colState"].Value = SheetStateDescription.GetDescription(info.State); row.Cells["colMemo"].Value = info.Memo; if (info.State == SheetState.Canceled) { row.DefaultCellStyle.ForeColor = Color.Red; row.DefaultCellStyle.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Strikeout, System.Drawing.GraphicsUnit.Point, ((byte)(134))); } if (!_Sheets.Exists(it => it.ID == info.ID)) { _Sheets.Add(info); } }
protected override void ShowItemInGridViewRow(DataGridViewRow row, object item) { ExpenditureRecord info = item as ExpenditureRecord; row.Tag = info; row.Cells["colID"].Value = info.ID; row.Cells["colSheetDate"].Value = info.SheetDate.ToString("yyyy-MM-dd"); row.Cells["colPaymentMode"].Value = PaymentModeDescription.GetDescription(info.PaymentMode); row.Cells["colAmount"].Value = info.Amount; ExpenditureType et = categoryTree.GetExpenditureType(info.Category); row.Cells["colCategory"].Value = et != null ? et.Name : string.Empty; row.Cells["colCheckNum"].Value = info.CheckNum; row.Cells["colRequest"].Value = info.Request; row.Cells["colPayee"].Value = info.Payee; row.Cells["colOrderID"].Value = info.OrderID; row.Cells["colState"].Value = SheetStateDescription.GetDescription(info.State); row.Cells["colMemo"].Value = info.Memo; if (info.State == SheetState.Canceled) { row.DefaultCellStyle.ForeColor = Color.Red; row.DefaultCellStyle.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Strikeout, System.Drawing.GraphicsUnit.Point, ((byte)(134))); } if (_Sheets == null || !_Sheets.Exists(it => it.ID == info.ID)) { if (_Sheets == null) { _Sheets = new List <ExpenditureRecord>(); } _Sheets.Add(info); } }
protected override void ShowItemInGridViewRow(DataGridViewRow row, object item) { PurchaseOrder info = item as PurchaseOrder; row.Cells["colID"].Value = info.ID; row.Cells["colSheetDate"].Value = info.SheetDate.ToString("yyyy-MM-dd"); CompanyInfo supplier = supplierTree1.GetSupplier(info.SupplierID); row.Cells["colSupplier"].Value = supplier != null ? supplier.Name : string.Empty; row.Cells["colBuyer"].Value = info.Buyer; row.Cells["colDeliveryDate"].Value = info.DemandDate; row.Cells["colWithTax"].Value = info.WithTax; row.Cells["colState"].Value = SheetStateDescription.GetDescription(info.State); row.Cells["colMemo"].Value = info.Memo; if (info.State == SheetState.Canceled) { row.DefaultCellStyle.ForeColor = Color.Red; row.DefaultCellStyle.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Strikeout, System.Drawing.GraphicsUnit.Point, ((byte)(134))); } if (!_Sheets.Exists(it => it.ID == info.ID)) { _Sheets.Add(info); } }