Exemplo n.º 1
0
        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)
        {
            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);
            }
        }
Exemplo n.º 3
0
 public void Init()
 {
     this.Items.Clear();
     TextValueItem <PaymentMode>[] items = new TextValueItem <PaymentMode>[] {
         new TextValueItem <PaymentMode>(PaymentMode.Cash, PaymentModeDescription.GetDescription(PaymentMode.Cash)),
         new TextValueItem <PaymentMode>(PaymentMode.Prepay, PaymentModeDescription.GetDescription(PaymentMode.Prepay)),
         new TextValueItem <PaymentMode>(PaymentMode.YangChengTong, PaymentModeDescription.GetDescription(PaymentMode.YangChengTong)),
         new TextValueItem <PaymentMode>(PaymentMode.Pos, PaymentModeDescription.GetDescription(PaymentMode.Pos)),
         new TextValueItem <PaymentMode>(PaymentMode.ZhongShanTong, PaymentModeDescription.GetDescription(PaymentMode.ZhongShanTong)),
     };
     this.DataSource    = items;
     this.DisplayMember = "Text";
     this.DropDownStyle = ComboBoxStyle.DropDownList;
 }
 public void Init()
 {
     this.Items.Clear();
     TextValueItem <PaymentMode>[] items = new TextValueItem <PaymentMode>[] {
         new TextValueItem <PaymentMode>(PaymentMode.None, PaymentModeDescription.GetDescription(PaymentMode.None)),
         new TextValueItem <PaymentMode>(PaymentMode.Cash, PaymentModeDescription.GetDescription(PaymentMode.Cash)),
         new TextValueItem <PaymentMode>(PaymentMode.Transfer, PaymentModeDescription.GetDescription(PaymentMode.Transfer)),
         new TextValueItem <PaymentMode>(PaymentMode.Prepay, PaymentModeDescription.GetDescription(PaymentMode.Check)),
         new TextValueItem <PaymentMode>(PaymentMode.Prepay, PaymentModeDescription.GetDescription(PaymentMode.Prepay)),
     };
     this.DataSource    = items;
     this.DisplayMember = "Text";
     this.DropDownStyle = ComboBoxStyle.DropDownList;
 }
 private void ShowReportsOnGrid(List <CardLostRestoreRecord> items)
 {
     this.GridView.Rows.Clear();
     items = (from CardLostRestoreRecord cr in items
              orderby cr.LostDateTime descending
              select cr).ToList();
     foreach (CardLostRestoreRecord record in items)
     {
         int             index = GridView.Rows.Add();
         DataGridViewRow row   = GridView.Rows[index];
         row.Tag = record;
         row.Cells["colCardID"].Value          = record.CardID;
         row.Cells["colOwnerName"].Value       = record.OwnerName;
         row.Cells["colCardCertificate"].Value = record.CardCertificate;
         row.Cells["colCarPlate"].Value        = record.CarPlate;
         row.Cells["colLostDateTime"].Value    = record.LostDateTime;
         row.Cells["colLostOperator"].Value    = record.LostOperator;
         row.Cells["colLostMemo"].Value        = record.LostMemo;
         row.Cells["colLostCardCost"].Value    = record.LostCardCost;
         row.Cells["colPaymentMode"].Value     = record.PaymentMode == null ? string.Empty : PaymentModeDescription.GetDescription(record.PaymentMode.Value);
         row.Cells["colSettled"].Value         = record.SettleDateTime != null;
         row.Cells["colRestoreDateTime"].Value = record.RestoreDateTime;
         row.Cells["colRestoreOperator"].Value = record.RestoreOperator;
         row.Cells["colRestoreMemo"].Value     = record.RestoreMemo;
     }
 }