protected override void BeforeChange(DataColumn dc, DataRow ddr) { string ObjectName = this.myOfficeAccountDT.TableName; CLAS.OfficeAccountRow dr = (CLAS.OfficeAccountRow)ddr; switch (dc.ColumnName) { default: break; } }
public override void ApplySecurity(DataRow dr) { if (FileForm() != null && FileForm().ReadOnly) { return; } CLAS.OfficeAccountRow qrr = (CLAS.OfficeAccountRow)dr; UIHelper.EnableControls(officeAccountBindingSource, FM.GetCLASMng().GetOfficeAccount().CanEdit(qrr)); UIHelper.EnableCommandBarCommand(tsDelete, FM.GetCLASMng().GetOfficeAccount().CanDelete(qrr)); UIHelper.EnableCommandBarCommand(tsNew, FM.GetCLASMng().GetOfficeAccount().CanAdd(FM.CurrentFile)); }
protected override void AfterAdd(DataRow row) { CLAS.OfficeAccountRow dr = (CLAS.OfficeAccountRow)row; string ObjectName = this.myOfficeAccountDT.TableName; dr.OfficeAccountID = this.myA.AtMng.PKIDGet(ObjectName, 1); dr.FileId = myA.FM.CurrentFile.FileId; dr.TransactionDate = DateTime.Today; dr.PostingDate = DateTime.Now; dr.Amount = 0; dr.OfficeID = myA.FM.CurrentFile.LeadOfficeId; }
private void officeAccountBindingSource_CurrentChanged(object sender, EventArgs e) { try { CLAS.OfficeAccountRow qrr = CurrentRow(); if (qrr == null || qrr.IsNull("OfficeAccountID")) { return; } ApplySecurity(qrr); } catch (Exception x) { // UIHelper.HandleUIException(x); } }
protected override void BeforeUpdate(DataRow row) { atriumDB.SRPRow dr = (atriumDB.SRPRow)row; this.BeforeChange(dr.Table.Columns["SRPDate"], dr); this.BeforeChange(dr.Table.Columns["SRPSubmittedDate"], dr); if (!dr.IsTaxationCompletedNull() && dr.HasVersion(DataRowVersion.Original) && dr.IsNull(mySRPDT.TaxationCompletedColumn, DataRowVersion.Original)) //!dr["TaxationCompleted", DataRowVersion.Original].Equals(dr["TaxationCompleted", DataRowVersion.Current])) { OfficeAccountBE agentAcc = this.myA.GetCLASMng().GetOfficeAccount(); FileManager fm = myA.AtMng.GetFile(dr.FileID); decimal qraBalance = agentAcc.BalanceOn(dr.SRPDate); decimal srpTotal = dr.TotalTaxed; decimal qrw = 0; if (qraBalance != 0) { if (srpTotal < qraBalance) { qrw = srpTotal; } else { qrw = qraBalance; } CLAS.OfficeAccountRow agentAccRow = (CLAS.OfficeAccountRow)agentAcc.Add(fm.CurrentFile); agentAccRow.Amount = -qrw; agentAccRow.TransactionDate = dr.SRPDate; agentAccRow.PostingDate = DateTime.Today; agentAccRow.Description = "QR Withdrawal"; agentAccRow.Type = "QW"; agentAccRow.SRPID = dr.SRPID; } } }
protected override void AfterUpdate(DataRow dr) { CLAS.OfficeAccountRow r = (CLAS.OfficeAccountRow)dr; EFileBE.XmlAddToc(myA.AtMng.GetFile(r.FileId).CurrentFile, "officeaccount", "Acomptes de bureau", "Office Account", 180); }