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); } }
private void mnu_AttachmentAdd_Click(object sender, EventArgs e) { CustomerOtherReceivable item = UpdatingItem as CustomerOtherReceivable; if (item != null) { PerformAddAttach(item.ID, item.DocumentType, gridAttachment); } }
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { if (dataGridView1.Columns[e.ColumnIndex].Name == "colPaid") { CustomerOtherReceivable daifu = dataGridView1.Rows[e.RowIndex].Tag as CustomerOtherReceivable; if (daifu != null) { View.FrmReceivablePaymentAssigns frm = new View.FrmReceivablePaymentAssigns(); frm.ReceivableID = daifu.ID; frm.ShowDialog(); } } } }
protected override void ItemShowing() { CustomerOtherReceivable item = UpdatingItem as CustomerOtherReceivable; if (item != null) { this.txtID.Text = item.ID; this.txtID.Enabled = false; dtSheetDate.Value = item.SheetDate; txtAmount.DecimalValue = item.Amount; Customer = (new CompanyBLL(AppSettings.Current.ConnStr)).GetByID(item.CustomerID).QueryObject; txtCustomer.Text = Customer != null ? Customer.Name : string.Empty; txtMemo.Text = item.Memo; ShowOperations(item.ID, item.DocumentType, dataGridView1); ShowAttachmentHeaders(item.ID, item.DocumentType, this.gridAttachment); } }
protected override object GetItemFromInput() { CustomerOtherReceivable info = null; if (UpdatingItem == null) { info = new CustomerOtherReceivable(); } else { info = UpdatingItem as CustomerOtherReceivable; } if (txtID.Text == _AutoCreate) { info.ID = string.Empty; } info.SheetDate = dtSheetDate.Value; info.Amount = txtAmount.DecimalValue; info.CustomerID = Customer != null ? Customer.ID : null; info.Memo = txtMemo.Text; return(info); }