protected override void BeforeChange(DataColumn dc, DataRow ddr) { string ObjectName = this.myTaxingDT.TableName; CLAS.TaxingRow dr = (CLAS.TaxingRow)ddr; switch (dc.ColumnName) { case TaxingFields.Comment: if (dr.IsNull(dc)) { throw new RequiredException(atriumBE.Properties.Resources.ResourceManager.GetString(ObjectName + dc.ColumnName)); } break; case TaxingFields.ReasonCode: if (dr.IsNull(dc)) { throw new RequiredException(atriumBE.Properties.Resources.ResourceManager.GetString(ObjectName + dc.ColumnName)); } else if (!myA.CheckDomain(dr.ReasonCode, myA.FM.Codes("ReasonCode"))) { throw new AtriumException(atriumBE.Properties.Resources.BadDomainValue, dc.ColumnName, dr.Table.TableName, "Reason Code"); } break; case TaxingFields.OfficeID: if (dr.IsNull("OfficeID")) { throw new RequiredException(atriumBE.Properties.Resources.ResourceManager.GetString(ObjectName + dc.ColumnName)); } else if (!myA.CheckDomain(dr.OfficeID, myA.FM.Codes("officelist"))) { throw new AtriumException(atriumBE.Properties.Resources.BadDomainValue, dc.ColumnName, dc.Table.TableName, "Office List"); } break; case TaxingFields.OfficerID: if (dr.IsOfficerIDNull()) { throw new RequiredException(atriumBE.Properties.Resources.ResourceManager.GetString(ObjectName + dc.ColumnName)); } else if (!myA.CheckDomain(dr.OfficerID, myA.FM.Codes("claslist"))) { throw new AtriumException(atriumBE.Properties.Resources.BadDomainValue, dc.ColumnName, dc.Table.TableName, "Officer List"); } break; case TaxingFields.TaxingDate: if (dr.IsTaxingDateNull()) { throw new RequiredException(atriumBE.Properties.Resources.TaxingTaxingDate); } myA.IsValidDate(atriumBE.Properties.Resources.TaxingTaxingDate, dr.TaxingDate, false, DateTime.Today.AddMonths(-6), DateTime.Today, atriumBE.Properties.Resources.ValidationSixMonthsAgo, atriumBE.Properties.Resources.ValidationToday); break; default: break; } }
private void uiCommandManager1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { try { Janus.Windows.UI.CommandBars.UICommandBar bar = uiCommandManager1.CommandBars["cbMergeToolbar"]; if (bar.Commands.Contains(e.Command.Key) && bar.Commands[e.Command.Key].Commands.Count > 0) { bar.Commands[e.Command.Key].Expand(); } switch (e.Command.Key) { case "tsSaveIRP": SaveIRP(); break; case "tsDeleteIRP": DeleteIRP(); break; case "tsNewIRP": NewIRP(); break; case "tsGoToBillingReview": if (myOfficeMan.CurrentOffice.UsesBilling) { ucBase ctl = FileForm().MoreInfo("billingreview"); ucSRPBillingReview brCtl = (ucSRPBillingReview)ctl; brCtl.MoreInfo("billingreview", CurrentRowIRP().SRPID, CurrentRowIRP().IRPId); } break; case "tsGoToSRP": FileForm().MoreInfo("srp", CurrentRowIRP().SRPID); break; case "cmdJumpToActivity": fFile nFile = FileForm().MainForm.OpenFile(CurrentRowIRP().FileID); nFile.MoreInfo("activity"); break; case "cmdJumpToTaxation": fFile nFile1 = FileForm().MainForm.OpenFile(CurrentRowIRP().FileID); nFile1.MoreInfo("irp", CurrentRowIRP().IRPId); break; } if (e.Command.Key.StartsWith("cmdTaxRec")) { CLAS.TaxingRow tr = (CLAS.TaxingRow)e.Command.Tag; fFile nFile = FileForm().MainForm.OpenFile(tr.FileID); nFile.MoreInfo("taxing", tr.TaxingID); } } catch (Exception x) { UIHelper.HandleUIException(x); } }
protected override void BeforeUpdate(DataRow row) { CLAS.TaxingRow dr = (CLAS.TaxingRow)row; if (dr.IsTaxingDateNull()) { this.BeforeChange(dr.Table.Columns[TaxingFields.TaxingDate], dr); } this.BeforeChange(dr.Table.Columns[TaxingFields.Comment], dr); this.BeforeChange(dr.Table.Columns[TaxingFields.ReasonCode], dr); }
void newCmd_Click(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { CLAS.TaxingRow tr = (CLAS.TaxingRow)e.Command.Tag; if (tr == null) { return; } FileForm().MoreInfo("taxing", tr.TaxingID); }
public override bool CanEdit(DataRow dr) { if (dr == null) { return(true); } if (dr.RowState == DataRowState.Added) { return(true); } bool allowEdit = false; CLAS.TaxingRow taxingRow = (CLAS.TaxingRow)dr; if (myA.FM.AllowedForOwnerOrSysAdmin() && myA.AtMng.SecurityManager.CanUpdate(taxingRow.FileID, atSecurity.SecurityManager.Features.Taxing) == atSecurity.SecurityManager.LevelPermissions.All) { //you are CLAS and you have perms on Taxing if (taxingRow.Closed && !taxingRow.IsIRPIdNull()) { //check to see if taxation is completed on SRP atriumDB.IRPRow irprow = myA.FM.DB.IRP.FindByIRPId(taxingRow.IRPId); if (irprow == null) // hmmm. how is it that irprow is null? assume it's a no go { return(false); } if (irprow.SRPRow == null) // oops, gotta load it to check it { myA.FM.GetSRP().Load(irprow.SRPID); } if (myA.FM.GetSRP().isSRPTaxationCompleted(irprow)) { allowEdit = false; //taxation completed - edits never allowed; } //else if (!irprow.IsDateTaxedNull() && !irprow.IsOfficerIDNull() && irprow["DateTaxed", DataRowVersion.Current].Equals(irprow["DateTaxed", DataRowVersion.Original]) && irprow["OfficerID", DataRowVersion.Current].Equals(irprow["OfficerID", DataRowVersion.Original])) // allowEdit = false; // irp taxed - edits not allowed; else { allowEdit = true; //taxation not completed yet; allow edits by CLAS w/ taxing perm } } else if (!taxingRow.Closed) { allowEdit = true; } } return(allowEdit); }
public override void ApplySecurity(DataRow dr) { if (dr == null) { UIHelper.EnableControls(taxingBindingSource, false); UIHelper.EnableCommandBarCommand(tsDelete, false); btnJumpToIRP.Visible = false; } else { CLAS.TaxingRow cbr = (CLAS.TaxingRow)dr; UIHelper.EnableControls(taxingBindingSource, FM.GetCLASMng().GetTaxing().CanEdit(cbr)); UIHelper.EnableCommandBarCommand(tsDelete, FM.GetCLASMng().GetTaxing().CanDelete(cbr)); btnJumpToIRP.Visible = !cbr.IsIRPIdNull(); //allow jumping to billing file if tax rec linked to IRP } closedUICheckBox.Enabled = false; }
protected override void AfterAdd(DataRow row) { CLAS.TaxingRow dr = (CLAS.TaxingRow)row; string ObjectName = this.myTaxingDT.TableName; dr.FileID = myA.FM.CurrentFileId; dr.TaxingID = this.myA.AtMng.PKIDGet(ObjectName, 1); dr.TaxingDate = DateTime.Today; //dr.OfficeCode=this.myA.AtMng.OfficeLoggedOn.OfficeCode; //get officecode for leadoffice dr.OfficeCode = this.myA.FM.CurrentFile.LeadOfficeCode; dr.OfficeID = this.myA.FM.CurrentFile.LeadOfficeId; dr.OfficerCode = this.myA.AtMng.WorkingAsOfficer.OfficerCode; dr.OfficerID = this.myA.AtMng.WorkingAsOfficer.OfficerId; dr.PrevInstructed = false; dr.Closed = false; }
protected override void AfterChange(DataColumn dc, DataRow ddr) { string ObjectName = this.myTaxingDT.TableName; CLAS.TaxingRow dr = (CLAS.TaxingRow)ddr; switch (dc.ColumnName) { case "Closed": if (dr.Closed) { } else { dr.SetIRPIdNull(); } break; } }
public override bool CanDelete(DataRow row) { bool allowDelete = false; CLAS.TaxingRow taxingRow = (CLAS.TaxingRow)row; if (myA.AtMng.SecurityManager.CanDelete(taxingRow.FileID, atSecurity.SecurityManager.Features.Taxing) == atSecurity.SecurityManager.LevelPermissions.All) { allowDelete = true; if (taxingRow.Closed) { allowDelete = false; bool canOverride = myA.AtMng.SecurityManager.CanOverride(taxingRow.FileID, atSecurity.SecurityManager.Features.Taxing) == atSecurity.SecurityManager.ExPermissions.Yes; if (canOverride) { allowDelete = true; } } } return(allowDelete); }
protected override void AfterUpdate(DataRow dr) { CLAS.TaxingRow r = (CLAS.TaxingRow)dr; EFileBE.XmlAddToc(myA.FM.CurrentFile, "taxing", "Taxing recommendations", "Recommendations de taxation", 200); }
public void closeTaxRec(CLAS.TaxingRow taxRow, atriumDB.IRPRow irpRow) { taxRow.Closed = true; taxRow.IRPId = irpRow.IRPId; }