internal void CreateGroup(officeDB.OfficeRow or, FileManager offFM) { SecurityDB.secGroupRow gr = (SecurityDB.secGroupRow)offFM.AtMng.SecurityManager.GetsecGroup().Add(null); gr.GroupName = or.OfficeName; gr.DescE = or.OfficeName; gr.DescF = or.OfficeNameFre; BusinessProcess bp = myA.GetBP(); bp.AddForUpdate(offFM.AtMng.SecurityManager.GetsecGroup()); bp.Update(); offFM.EFile.BreakInherit(); atriumDB.secFileRuleRow sfr = (atriumDB.secFileRuleRow)offFM.GetsecFileRule().Add(offFM.CurrentFile); sfr.FileId = offFM.CurrentFile.FileId; sfr.GroupId = gr.GroupId; sfr.RuleId = (int)atSecurity.SpecialRules.GeneralRule; BusinessProcess bp1 = myA.GetBP(); bp1.AddForUpdate(offFM.GetsecFileRule()); bp1.Update(); //get rid of new row if present as database new row will have been returned with a different pkid lmDatasets.atriumDB.secFileRuleRow sfr0 = offFM.DB.secFileRule.FindById(0); if (sfr0 != null) { offFM.DB.secFileRule.RemovesecFileRuleRow(sfr0); offFM.DB.secFileRule.AcceptChanges(); } }
public officeDB.OfficeRow Load(int OfficeId) { officeDB.OfficeRow or = myOfficeDT.FindByOfficeId(OfficeId); if (or == null) { if (myA.AtMng.AppMan.UseService) { Fill(myA.AtMng.AppMan.AtriumX().OfficeLoad(OfficeId, myA.AtMng.AppMan.AtriumXCon)); } else { try { Fill(myDAL.LoadByte(OfficeId)); } catch (System.Runtime.Serialization.SerializationException x) { RecoverDAL(); Fill(myDAL.LoadByte(OfficeId)); } } or = myOfficeDT.FindByOfficeId(OfficeId); } return(or); }
private void officeBindingSource_CurrentChanged(object sender, EventArgs e) { try { if (officeBindingSource.Current == null) { return; } selectedOffice = (officeDB.OfficeRow)((DataRowView)officeBindingSource.Current).Row; //ugly translation issue with officename/officenamefre if (Atmng.AppMan.Language.ToUpper() == "FRE") { lblCurrentFile.Text = selectedOffice.OfficeNameFre + " (" + selectedOffice.OfficeCode + ")"; } else { lblCurrentFile.Text = selectedOffice.OfficeName + " (" + selectedOffice.OfficeCode + ")"; } } catch (Exception x) { UIHelper.HandleUIException(x); } }
internal officeDB.OfficeRow Load(string officeCode) { if (myA.AtMng.AppMan.UseService) { Fill(myA.AtMng.AppMan.AtriumX().OfficeLoadbyOfficeCode(officeCode, myA.AtMng.AppMan.AtriumXCon)); } else { try { Fill(myDAL.LoadByOfficeCode(officeCode)); } catch (System.Runtime.Serialization.SerializationException x) { RecoverDAL(); Fill(myDAL.LoadByOfficeCode(officeCode)); } } if (this.myOfficeDT.Select("officeCode='" + officeCode + "'").Length == 1) { officeDB.OfficeRow or = (officeDB.OfficeRow) this.myOfficeDT.Select("officeCode='" + officeCode + "'")[0]; return(or); } else { throw new AtriumException(atriumBE.Properties.Resources.BadOfficeCode); } }
private void CalcFees(atriumDB.ActivityTimeRow dr) { dr.Minutes = dr.Hours * 60; if (!dr.Final) { if (!dr.IsHoursNull()) { officeDB.OfficeRow or = this.myA.AtMng.GetOffice(dr.OfficeId).CurrentOffice; //officeDB.OfficeRow or = (officeDB.OfficeRow)this.myA.AtMng.officeMng.DB.Office.Select("officeID=" + dr.OfficeId.ToString())[0]; //JLL: 2014-10-16 Change from minute to hour //dr.FeesClaimed = decimal.Round(dr.Hours * or.HourlyRate / 60, 2, MidpointRounding.AwayFromZero); dr.FeesClaimed = decimal.Round(dr.Hours * or.HourlyRate, 2, MidpointRounding.AwayFromZero); if (!this.myA.AtMng.GetOffice(dr.OfficeId).CurrentOffice.IsTaxRateNull()) { dr.FeesClaimedTax = Math.Round(this.myA.AtMng.GetOffice(dr.OfficeId).CurrentOffice.TaxRate *dr.FeesClaimed, 2, MidpointRounding.AwayFromZero); } } else { dr.SetFeesClaimedNull(); dr.SetFeesClaimedTaxNull(); } dr.EndEdit(); } }
private DataRow AddX(officeDB.OfficeRow cr) { atriumDB.AddressRow dr = (atriumDB.AddressRow)base.Add(cr); cr.AddressId = dr.AddressId; return(dr); }
private void officeBindingSource_CurrentChanged(object sender, EventArgs e) { officeDB.OfficeRow dr = CurrentRow(); if (dr == null) { return; } ApplySecurity(dr); }
public override void ApplySecurity(DataRow dr) { if (FileForm() != null && FileForm().ReadOnly) { return; } officeDB.OfficeRow cbr = (officeDB.OfficeRow)dr; UIHelper.EnableControls(officeBindingSource, FM.LeadOfficeMng.GetOffice().CanEdit(cbr)); UIHelper.EnableCommandBarCommand(tsDelete, FM.LeadOfficeMng.GetOffice().CanDelete(cbr)); ApplyAddressSecurity(CurrentRowAddress()); }
//JLL: 2007/07/28 - added after update to handle added office/new files //what about permissions? completely separate? as part of creating office? protected override void AfterUpdate(DataRow dr) { officeDB.OfficeRow or = (officeDB.OfficeRow)dr; FileManager fm = this.myA.AtMng.GetFile(or.OfficeFileId); System.Xml.XmlDocument xd = new System.Xml.XmlDocument(); xd.InnerXml = fm.CurrentFile.FileStructXml; MyXml(fm.CurrentFile, xd, or); fm.CurrentFile.FileStructXml = xd.InnerXml; //assume it's new - how else? if (fm.CurrentFile.LeadOfficeId != or.OfficeId) { //JLL: 2009/07/28 ////update lead office to new office //fm.CurrentFile.LeadOfficeId = or.OfficeId; //atriumDB.FileOfficeRow forow = (atriumDB.FileOfficeRow)fm.GetFileOffice().Add(fm.CurrentFile); //forow.IsLead = true; //forow.OfficeId = or.OfficeId; //rebuild file structure and save //fm.EFile.Update(); //fm.GetFileXRef().Update(); //fm.GetFileOffice().Update(); //fm.GetFileContact().Update(); //fm.EFile.Update(); //fm.AppMan.Commit(); //create new group, break inheritance, add new group with office file rule //CreateGroup(or, fm); //create Personnel Management //FileManager PMFile = fm.AtMng.CreateFile(fm); //PMFile.CurrentFile.NameE = "Personnel Management"; //PMFile.CurrentFile.NameF = "Personnel Management"; //PMFile.CurrentFile.FileType = "PM"; //PMFile.EFile.Update(); //PMFile.GetFileXRef().Update(); //PMFile.GetFileOffice().Update(); //PMFile.GetFileContact().Update(); //PMFile.EFile.Update(); //PMFile.AppMan.Commit(); } //fm.EFile.CalcFileStructXml(fm.CurrentFile, false, false); //fm.EFile.Update(); //fm.AppMan.Commit(); }
public override bool CanDelete(DataRow dr) { bool ok = false; officeDB.OfficeRow fo = (officeDB.OfficeRow)dr; atSecurity.SecurityManager.LevelPermissions perm = myA.AtMng.SecurityManager.CanDelete(fo.OfficeFileId, atSecurity.SecurityManager.Features.Office); if (perm != atSecurity.SecurityManager.LevelPermissions.No) { ok = true; } return(ok); }
protected override void AfterChange(DataColumn dc, DataRow ddr) { officeDB.OfficeRow dr = (officeDB.OfficeRow)ddr; switch (dc.ColumnName) { case "OfficeFileId": if (dr.IsAddressIdNull()) { //atriumDB.AddressRow ar = (atriumDB.AddressRow)this.myA.AtMng.GetFile(dr.OfficeFileId, false).GetAddress().Add(dr); //dr.AddressId = ar.AddressId; } break; } }
public officeDB.OfficerRow AddFromContact(atriumDB.ContactRow contactR, officeDB.OfficeRow officeR) { officeDB.OfficerRow or = (officeDB.OfficerRow)Add(officeR); or.ContactId = contactR.ContactId; or.OfficerId = or.ContactId; or.OfficeId = officeR.OfficeId; foreach (DataColumn dc in contactR.Table.Columns) { if (!contactR.IsNull(dc)) { or[dc.ColumnName] = contactR[dc]; } } return(or); }
public void GenSrp(int srpId) { atriumDB.SRPRow drSrp = this.Load(srpId); officeDB.OfficeRow drOffice = this.myA.LeadOfficeMng.CurrentOffice; //.GetOffice(drSrp.OfficeID); if (!drOffice.UsesBilling) { throw new AtriumException(Resources.SRPNoOnlineBilling); } if (drSrp.IsSRPSubmittedDateNull()) { this.myA.AppMan.ExecuteSP("InsertIRP", drSrp.OfficeID, srpId); } else { throw new AtriumException(Resources.SRPAlreadySubmitted); } }
protected override void AfterChange(DataColumn dc, DataRow ddr) { string ObjectName = this.myJudgmentDT.TableName; CLAS.JudgmentRow dr = (CLAS.JudgmentRow)ddr; switch (dc.ColumnName) { case "OfficeID": case "JudgmentDate": if (!dr.IsJudgmentDateNull() && !dr.IsOfficeIDNull()) { officeDB.OfficeRow drOffice = this.myA.AtMng.GetOffice(dr.OfficeID).CurrentOffice; if (!drOffice.IsJudgmentLPNull()) { dr.JudgmentLPDate = dr.JudgmentDate.AddYears(drOffice.JudgmentLP); } else { dr.JudgmentLPDate = dr.JudgmentDate.AddYears(10); } myA.FM.GetActivityBF().MaintainBFDate(dr.JudgmentID, "Judgment", "JUDGMENTLPDATE", dr.JudgmentLPDate); dr.EndEdit(); } break; case "JudgmentLPDate": myA.FM.GetActivityBF().MaintainBFDate(dr.JudgmentID, "Judgment", "JUDGMENTLPDATE", dr.JudgmentLPDate); break; case "SetJudgmentAccountDefaults": if (dr.SetJudgmentAccountDefaults) { SetJudgmentAccountDefaultValues(dr); } break; default: break; } }
internal officeDB.OfficeRow GetOffice(string officeCode) { GetOffice(); officeDB.OfficeRow drOff = this.myOffice.Load(officeCode); try { if (drOff == null) { throw new AtriumException(Resources.BadOfficeCode); } myCurrentOfficeId = drOff.OfficeId; return(drOff); } catch (Exception exc) { throw exc; } }
protected override void AfterChange(DataColumn dc, DataRow ddr) { string ObjectName = this.myDisbursementDT.TableName; atriumDB.DisbursementRow dr = (atriumDB.DisbursementRow)ddr; switch (dc.ColumnName) { case DisbursementFields.DisbTaxable: case "TaxRateId": if (!dr.Final) { if (dr.IsDisbTaxableNull()) { dr.SetDisbTaxNull(); } else { if (!dr.IsTaxRateIdNull()) { appDB.TaxRateRow taxRateRow = myA.AtMng.DB.TaxRate.FindByTaxRateId(dr.TaxRateId); dr.DisbTax = dr.DisbTaxable * taxRateRow.TaxRate; } else { officeDB.OfficeRow drOffice = this.myA.AtMng.GetOffice(dr.OfficeId).CurrentOffice; dr.DisbTax = dr.DisbTaxable * (drOffice.IsTaxRateNull() ? 0 : drOffice.TaxRate); } dr.DisbTax = Math.Round(dr.DisbTax, 2, MidpointRounding.AwayFromZero); } dr.EndEdit(); } break; default: break; } }
public void Export(string type, int srpId, string path) { atriumDB.SRPRow drSrp = this.Load(srpId); officeDB.OfficeRow drOffice = this.myA.LeadOfficeMng.CurrentOffice;//.GetOffice(drSrp.OfficeID); DataSet ds; // string fileName = drOffice.OfficeCode + "_" + drSrp.SRPDate.ToString("yyyyMMdd"); if (type == "Disb") { // fileName += "_Disb"; ds = this.myA.AppMan.ExecuteDataset("ExportDisbursements", drSrp.OfficeID, drSrp.SRPID); } else // (type == "Fees") { // fileName += "_Fees"; ds = this.myA.AppMan.ExecuteDataset("ExportFees", drSrp.OfficeID, drSrp.SRPID); } //string fullFilePath = System.IO.Path.Combine(filePath,fileName); this.myA.WriteDataTableToCSV(path, ds.Tables[0], "", true); //docDB.DocumentRow dr = (docDB.DocumentRow)myA.GetDocMng().GetDocument().Add(myA.CurrentFile); //myA.GetDocMng().GetDocContent().Add(dr); //dr.DocContentRow.Ext = ".csv"; //dr.efSubject = DocumentBE.VerifySubjectLength(fileName); //dr.DocContentRow.ContentsAsText = sb.ToString(); //dr.IsDraft = false; //BusinessProcess bp = myA.GetDocMng().GetBP(); //bp.AddForUpdate(myA.GetDocMng().GetDocContent()); //bp.AddForUpdate(myA.GetDocMng().GetDocument()); //bp.Update(); //return dr.DocId; }
public override void ApplySecurity(DataRow brow) { CLAS.FileHistoryRow br = (CLAS.FileHistoryRow)brow; UIHelper.EnableControls(fileHistoryBindingSource, FM.GetCLASMng().GetFileHistory().CanEdit(br)); UIHelper.EnableCommandBarCommand(tsDelete, FM.GetCLASMng().GetFileHistory().CanDelete(br)); if (FM.GetCLASMng().GetFileHistory().CanEdit(br)) { //toggle appropriate fields //OWNER if (FM.CurrentFile.OwnerOfficeId == FM.AtMng.WorkingAsOfficer.OfficeId) { officeDB.OfficeRow or = FM.AtMng.OfficeMng.DB.Office.FindByOfficeId(FM.CurrentFile.LeadOfficeId); if (or == null) { or = FM.AtMng.GetOffice(FM.CurrentFile.LeadOfficeId).CurrentOffice; } if (or.IsOnLine && FM.CurrentFile.LeadOfficeId != FM.CurrentFile.OwnerOfficeId) //lead is online { receivedByOfficeDateCalendarCombo.ReadOnly = true; returnedByOfficeDateCalendarCombo.ReadOnly = true; ucMultiDropDown1.ReadOnly = true; } } else //AGENT { sentToOfficeDateCalendarCombo.ReadOnly = true; officeIducOfficeSelectBox.ReadOnly = true; receivedFromOfficeDateCalendarCombo.ReadOnly = true; if (br.OfficeId != FM.AtMng.WorkingAsOfficer.OfficeId) { receivedByOfficeDateCalendarCombo.ReadOnly = true; returnedByOfficeDateCalendarCombo.ReadOnly = true; ucMultiDropDown1.ReadOnly = true; } } } }
protected override void AfterAdd(DataRow row) { officeDB.OfficeRow dr = (officeDB.OfficeRow)row; string ObjectName = this.myOfficeDT.TableName; if (dr.IsNull("OfficeId") || dr.OfficeId != 0) { dr.OfficeId = this.myA.AtMng.PKIDGet(ObjectName, 1); } dr.IsOnLine = false; dr.UsesBilling = false; dr.Retainer = false; dr.ReappointedDate = DateTime.Today; dr.IsMail = false; dr.Active = true; dr.HourlyRate = 0; dr.Even = false; dr.IsBranch = false; dr.IsLrmOffice = false; dr.UploadsDisb = false; dr.IsClientOffice = false; }
public void Resolve(officeDB.OfficeRow or, docDB.RecipientRow newR) { newR.Address = myA.FM.GetAddress().Load(or.AddressId).EmailAddress; newR.OfficeId = or.OfficeId; newR.Name = or.OfficeName + " (" + or.OfficeCode + ")"; }
public void MyXml(atriumDB.EFileRow efr, System.Xml.XmlDocument xd, officeDB.OfficeRow or) { EFileBE.XmlAddToc(xd, "office", "Office", "Bureau", 160, or.OfficeId.ToString()); EFileBE.XmlAddToc(xd, "officer", "Personnel", "Personnel", 170); }
protected override void BeforeChange(DataColumn dc, DataRow ddr) { string ObjectName = this.myFileHistoryDT.TableName; CLAS.FileHistoryRow dr = (CLAS.FileHistoryRow)ddr; switch (dc.ColumnName) { case "SentToOfficeDate": if (dr.IsSentToOfficeDateNull()) { throw new RequiredException(Resources.FileHistorySentToOfficeDate); } if (myA.FM.CurrentFile.IsOpenedDateNull()) { throw new RelatedException(Resources.FileHistorySentToOfficeDate, Resources.EFileOpenedDate); } myA.IsValidDate(Resources.FileHistorySentToOfficeDate, dr.SentToOfficeDate, false, myA.FM.CurrentFile.OpenedDate, DateTime.Today.AddDays(7), Resources.EFileOpenedDate, Resources.ValidationSevenDaysLater); //this should be moved to before update // ok, moved 2015-04-29 JLL to row.added condition //if (dr.IsReceivedByOfficeDateNull()) //{ // this.myA.FM.GetFileOffice().AddOfficeToFile(dr.OfficeId, false, true, false); //} break; case "ReceivedByOfficeDate": if (myA.FM.CurrentFile.LeadOfficeId != this.myA.AtMng.WorkingAsOfficer.OfficeId) { //and lead office is not online officeDB.OfficeRow or = this.myA.AtMng.OfficeMng.DB.Office.FindByOfficeId(myA.FM.CurrentFile.LeadOfficeId); if (or == null) { or = this.myA.AtMng.GetOffice(myA.FM.CurrentFile.LeadOfficeId).CurrentOffice; } if (or.IsOnLine && myA.FM.CurrentFile.StatusCode == "O") { throw new AtriumException(Resources.OnlyTheLeadOfficeCanReceiveTheFile); } } if (!dr.IsReceivedByOfficeDateNull()) { if (dr.IsSentToOfficeDateNull()) { throw new RelatedException(Resources.FileHistoryReceivedByOfficeDate, Resources.FileHistorySentToOfficeDate); } myA.IsValidDate(Resources.FileHistoryReceivedByOfficeDate, dr.ReceivedByOfficeDate, true, dr.SentToOfficeDate, DateTime.Today, Resources.FileHistorySentToOfficeDate, Resources.ValidationToday); } break; case "ReturnedByOfficeDate": if (!dr.IsReturnedByOfficeDateNull()) { if (dr.IsReceivedByOfficeDateNull()) { throw new RelatedException(Resources.FileHistoryReturnedByOfficeDate, Resources.FileHistoryReceivedByOfficeDate); } myA.IsValidDate(Resources.FileHistoryReturnedByOfficeDate, dr.ReturnedByOfficeDate, true, dr.ReceivedByOfficeDate, DateTime.Today, Resources.FileHistoryReceivedByOfficeDate, Resources.ValidationToday); } break; case "ReceivedFromOfficeDate": if (!dr.IsReceivedFromOfficeDateNull()) { if (dr.IsReturnedByOfficeDateNull()) { throw new RelatedException(Resources.FileHistoryReceivedFromOfficeDate, Resources.FileHistoryReturnedByOfficeDate); } myA.IsValidDate(Resources.FileHistoryReceivedFromOfficeDate, dr.ReceivedFromOfficeDate, true, dr.ReturnedByOfficeDate, DateTime.Today, Resources.FileHistoryReturnedByOfficeDate, Resources.ValidationToday); } break; case "OfficeId": if (dr.IsNull(dc)) { throw new RequiredException(Resources.FileHistoryOfficeId); } else if (!myA.CheckDomain(dr.OfficeId, myA.FM.Codes("OfficeList"))) { throw new AtriumException(atriumBE.Properties.Resources.BadDomainValue, dc.ColumnName, dr.Table.TableName, "Office List"); } //don't allow officeid to be updated after it has been created if (dr.RowState != DataRowState.Added && !ddr[dc, DataRowVersion.Current].Equals(ddr[dc, DataRowVersion.Original])) { throw new AtriumException("The Office Code cannot be changed. Either return the file, or delete the File History record altogether (if applicable)"); } break; case "BillingCode": if (dr.IsBillingCodeNull()) { throw new RequiredException(Resources.FileHistoryBillingCode); } break; default: break; } }
protected override void BeforeUpdate(DataRow row) { officeDB.OfficeRow dr = (officeDB.OfficeRow)row; FileManager fm = this.myA.AtMng.GetFile(dr.OfficeFileId); fm.CurrentFile.NameE = dr.OfficeName; fm.CurrentFile.NameF = dr.OfficeNameFre; //JLL: 2007/07/28 //commented out below, fails to execute properly - moved to afterupdate if (dr.RowState == DataRowState.Added) { fm.GetFileOffice().AddOfficeToFile(dr.OfficeId, false, true, false); } // atriumDB.EFileRow currentFile=fm.CurrentFile; // atriumDB.EFileRow pmFile=(atriumDB.EFileRow)fm.EFile.Add(currentFile); // pmFile.BeginEdit(); // pmFile.LeadOfficeId = currentFile.LeadOfficeId; // pmFile.NameE="Personnel Management"; // pmFile.NameF="Personnel Management"; // pmFile.FileType="PM"; // pmFile.EndEdit(); // //fm.CurrentFile=currentFile; // if(dr.IsOnLine) // { // //add help desk file // atriumDB.EFileRow helpFile=(atriumDB.EFileRow)fm.EFile.Add(currentFile); // helpFile.BeginEdit(); // helpFile.LeadOfficeId = currentFile.LeadOfficeId; // helpFile.NameE="Help Desk Requests"; // helpFile.NameF="Help Desk Requests"; // helpFile.FileType="HD"; // helpFile.EndEdit(); // //fm.CurrentFile=currentFile; // } // //JLL: How do i get that data loaded in here? // if(dr.CB) //OfficeType data not loaded // { // //add payment file // atriumDB.EFileRow payFile=(atriumDB.EFileRow)fm.EFile.Add(currentFile); // payFile.BeginEdit(); // payFile.LeadOfficeId = currentFile.LeadOfficeId; // payFile.NameE="Receipt and Remittance of Payments"; // payFile.NameF="Receipt and Remittance of Payments"; // payFile.FileType="AC"; // payFile.EndEdit(); // //fm.CurrentFile=currentFile; // } // //JLL: How do i get that data loaded in here? // if(dr.Billing) //OfficeType data not loaded // { // //add billing file // atriumDB.EFileRow billFile=(atriumDB.EFileRow)fm.EFile.Add(currentFile); // billFile.BeginEdit(); // billFile.LeadOfficeId = currentFile.LeadOfficeId; // billFile.NameE="Billings"; // billFile.NameF="Billings"; // billFile.FileType="AB"; // billFile.EndEdit(); // //fm.CurrentFile=currentFile; // } // //fm.CurrentFile=currentFile; //} }
protected override void AfterChange(DataColumn dc, DataRow ddr) { string ObjectName = this.myIRPDT.TableName; atriumDB.IRPRow dr = (atriumDB.IRPRow)ddr; officeDB.OfficeRow drOffice = this.myA.AtMng.GetOffice(dr.OfficeID).CurrentOffice; switch (dc.ColumnName) { case "FeesTaxed": if (dr.IsFeesTaxedNull()) { dr.SetFeesTaxedTaxNull(); } else { dr.FeesTaxedTax = decimal.Round(dr.FeesTaxed * (drOffice.IsTaxRateNull()? 0 : drOffice.TaxRate), 2, MidpointRounding.AwayFromZero); } dr.EndEdit(); break; case "DisbursementTaxed": if (dr.IsDisbursementTaxedNull()) { dr.SetDisbursementTaxedTaxNull(); } else { officeDB.OfficeRow officeRow = myA.AtMng.GetOffice().GetOffice(dr.OfficeID); if (!officeRow.IsOnLine) { dr.DisbursementTaxedTax = decimal.Round(dr.DisbursementTaxed * (drOffice.IsTaxRateNull() ? 0 : drOffice.TaxRate), 2, MidpointRounding.AwayFromZero); } } dr.EndEdit(); break; case "FeesClaimed": if (dr.IsFeesClaimedNull()) { dr.SetFeesClaimedTaxNull(); } else { dr.FeesClaimedTax = decimal.Round(dr.FeesClaimed * (drOffice.IsTaxRateNull() ? 0 : drOffice.TaxRate), 2, MidpointRounding.AwayFromZero); } dr.EndEdit(); break; case "DisbursementClaimed": if (dr.IsDisbursementClaimedNull()) { dr.SetDisbursementClaimedTaxNull(); } else { officeDB.OfficeRow officeRow = myA.AtMng.GetOffice().GetOffice(dr.OfficeID); if (!officeRow.IsOnLine) { dr.DisbursementClaimedTax = decimal.Round(dr.DisbursementClaimed * (drOffice.IsTaxRateNull() ? 0 : drOffice.TaxRate), 2, MidpointRounding.AwayFromZero); } } dr.EndEdit(); break; case "DateTaxed": if (dr.SRPRow.IsTaxationBeganNull()) { dr.SRPRow.TaxationBegan = DateTime.Today; //dr.SRPRow.AcceptChanges(); dr.EndEdit(); dr.SRPRow.EndEdit(); } break; case "OfficerID": if (!dr.IsOfficerIDNull() && dr.IsDateTaxedNull()) { dr.DateTaxed = DateTime.Today; dr.FeesTaxed = dr.IsFeesClaimedNull()? 0 : dr.FeesClaimed; dr.FeesTaxedTax = dr.IsFeesClaimedTaxNull() ? 0 : dr.FeesClaimedTax; dr.DisbursementTaxed = dr.IsDisbursementClaimedNull() ? 0 : dr.DisbursementClaimed; dr.DisbursementTaxedTax = dr.IsDisbursementClaimedTaxNull()? 0 : dr.DisbursementClaimedTax; dr.DisbursementTaxExemptTaxed = dr.IsDisbursementTaxExemptClaimedNull() ? 0 : dr.DisbursementTaxExemptClaimed; dr.EndEdit(); } break; case "SIN": try { //FileManager fm = myA.AtMng.GetFileBySIN(dr.SIN); //dr.FileID = fm.CurrentFile.FileId; //fm.Dispose(); //dr.EndEdit(); } catch (Exception x) { System.Diagnostics.Trace.WriteLine(x.Message); throw new AtriumException(atriumBE.Properties.Resources.SINNotFound); } break; default: break; } }
protected override void BeforeChange(DataColumn dc, DataRow ddr) { string ObjectName = this.myOfficeDT.TableName; officeDB.OfficeRow dr = (officeDB.OfficeRow)ddr; switch (dc.ColumnName) { case "OfficeName": if (dr.IsOfficeNameNull()) { throw new RequiredException(Resources.OfficeOfficeName); } break; case "OfficeNameFre": if (dr.IsOfficeNameFreNull()) { throw new RequiredException(Resources.OfficeOfficeNameFre); } break; case "OfficeTypeCode": if (dr.IsOfficeTypeCodeNull()) { throw new RequiredException(Resources.OfficeOfficeTypeCode); } else if (!myA.CheckDomain(dr.OfficeTypeCode, myA.AtMng.GetFile().Codes("OfficeType"))) { throw new AtriumException(atriumBE.Properties.Resources.BadDomainValue, dc.ColumnName, dr.Table.TableName, "Office Type"); } break; case "AppointmentTypeCode": //if (dr.IsAppointmentTypeCodeNull()) // throw new RequiredException(Resources.OfficeAppointmentTypeCode); //else if (!myA.CheckDomain(dr.AppointmentTypeCode, myA.AtMng.GetFile().Codes("AppointmentType"))) // throw new AtriumException(atriumBE.Properties.Resources.BadDomainValue, dc.ColumnName, dr.Table.TableName, "Appointment Type"); break; case "CurrencyCode": if (dr.UsesBilling && dr.IsCurrencyCodeNull()) { throw new RequiredException(Resources.OfficeCurrencyCode); } else if (!dr.IsCurrencyCodeNull() && !myA.CheckDomain(dr.CurrencyCode, myA.AtMng.GetFile().Codes("CurrencyCode"))) { throw new AtriumException(atriumBE.Properties.Resources.BadDomainValue, dc.ColumnName, dr.Table.TableName, "Currency Code"); } break; case "DefaultTaxRate": if (!dr.IsDefaultTaxRateNull() && !myA.CheckDomain(dr.DefaultTaxRate, myA.AtMng.GetFile().Codes("TaxRate"))) { throw new AtriumException(atriumBE.Properties.Resources.BadDomainValue, dc.ColumnName, dr.Table.TableName, "Tax Rate"); } break; case "HourlyRate": if (dr.UsesBilling && dr.IsHourlyRateNull()) { throw new RequiredException(Resources.OfficeHourlyRate); } break; case "LetterSignatory": //if (dr.IsLetterSignatoryNull()) // throw new RequiredException(Resources.OfficeLetterSignatory); break; case "ReappointedDate": //if(dr.IsReappointedDateNull()) // throw new RequiredException(Resources.OfficeReappointedDate); //myA.IsValidDate(Resources.OfficeReappointedDate, dr.ReappointedDate, false, DebtorBE.CSLBegin, DateTime.Today,Resources.ValidationCSLBegin,Resources.ValidationToday); break; default: break; } }
private void setOfficeTooltip(LinkLabel lnk, officeDB.OfficeRow or) { lnk.Text = or.OfficeCode; string address = ""; if (!or.IsCityNull()) { address = or.City; } if (!or.IsProvinceCodeNull()) { if (address == "") { address = or.ProvinceCode; } else { address += ", " + or.ProvinceCode; } } if (!or.IsCountryCodeNull()) { if (address == "") { address = or.CountryCode; } else { address += ", " + or.CountryCode; } } string addressLbl = address + Environment.NewLine; string tel = ""; string tollfree = ""; string fax = ""; if (!or.IsWorkPhoneNull()) { string tmp = or.WorkPhone; if (!or.IsWorkExtensionNull()) { tmp += " Ext. " + or.WorkExtension; } tel = Environment.NewLine + Properties.Resources.TocOfficeTKTelephone + tmp; } if (!or.IsHomePhoneNull()) { tollfree = Environment.NewLine + Properties.Resources.TocOfficeTKTollFree + or.HomePhone; } if (!or.IsFaxNumberNull()) { fax = Environment.NewLine + Properties.Resources.TocOfficeTKFax + or.FaxNumber; } string jlpvalue = ""; if (!or.IsJudgmentLPNull()) //Judgment LP value exists, show it { jlpvalue = Environment.NewLine + Environment.NewLine + Properties.Resources.TocOfficeTKJudgLP + or.JudgmentLP.ToString() + Properties.Resources.TocOfficeTKyears; } string wlpvalue = ""; if (!or.IsWritofExecutionLPNull()) // { wlpvalue = Environment.NewLine + Properties.Resources.TocOfficeTKWritLP + or.WritofExecutionLP.ToString() + Properties.Resources.TocOfficeTKyears; } Janus.Windows.Common.SuperTipSettings jstSettings1 = new Janus.Windows.Common.SuperTipSettings(); jstSettings1.Image = Properties.Resources.office; if (fmCurrent.AtMng.AppMan.Language == "FRE") { jstSettings1.HeaderText = "(" + or.OfficeCode + ") " + or.OfficeNameFre; } else { jstSettings1.HeaderText = "(" + or.OfficeCode + ") " + or.OfficeName; } if (or.IsOnLine) { jstSettings1.FooterImage = Properties.Resources.atriumtrans16; jstSettings1.FooterText = or.OfficeCode + Properties.Resources.TocOfficeTKusesAtrium; } jstSettings1.Text = addressLbl + tel + tollfree + fax + jlpvalue + wlpvalue; janusSuperTip1.SetSuperTip(lnk, jstSettings1); }
public void SubmitSrp(int srpId) { atriumDB.SRPRow drSrp = this.Load(srpId); officeDB.OfficeRow drOffice = this.myA.LeadOfficeMng.CurrentOffice;// GetOffice(drSrp.OfficeID); FileManager fm = this.myA.AtMng.GetFile(drSrp.FileID); if (!drOffice.UsesBilling) { throw new AtriumException(Resources.SRPNoOnlineBilling); } if (drSrp.IsSRPSubmittedDateNull()) { try { drSrp.BeginEdit(); drSrp.SRPSubmittedDate = DateTime.Today; drSrp.EndEdit(); atriumDB.SRPRow newSrp = (atriumDB.SRPRow) this.Add(fm.CurrentFile); newSrp.FileID = fm.CurrentFile.FileId; newSrp.entryUser = "******"; if (myA.AtMng.AppMan.UseService) { DataSet ds = new DataSet(); //ds.Tables.Add((atriumDB.SRPDataTable)myDT.GetChanges()); System.Data.DataTable dt = myDT.GetChanges(); if (dt != null) { dt.ExtendedProperties.Remove("BE"); } ds.Tables.Add(dt); Fill(myA.AtMng.AppMan.AtriumX().SubmitSRP(atLogic.BEManager.CompressData(ds), drSrp.SRPID, myA.AtMng.AppMan.AtriumXCon)); } else { Fill(myDAL.SubmitSRP((atriumDB.SRPDataTable)myDT.GetChanges(), drSrp.SRPID)); } myA.SaveAll(); //this.myA.GetIRP().LoadBySRPId(srpId); ////TODO: long running transaction issue //BusinessProcess bp = myA.GetBP(); //bp.AddForUpdate(this); //foreach (atriumDB.IRPRow drIrp in drSrp.GetIRPRows()) //{ // this.myA.AppMan.ExecuteSP("SubmitIRP", drSrp.OfficeID, drIrp.IRPId, drIrp.FileID, drSrp.SRPDate); //} //bp.Update(); } catch { throw; } } else { throw new AtriumException(Resources.SRPAlreadySubmitted); } }
public override bool CanAdd(DataRow parent) { officeDB.OfficeRow er = (officeDB.OfficeRow)parent; return(myA.AtMng.SecurityManager.CanAdd(er.OfficeFileId, atSecurity.SecurityManager.Features.Officer) > atSecurity.SecurityManager.ExPermissions.No); }
public void LoadTOC() { pnlDockTop.Height = defaultTopHeight; if (fmCurrent.DB.FileXRef.Select("LinkType=0 and fileid=" + fmCurrent.CurrentFileId.ToString()).Length > 0) { pnlBrowseFiles.Enabled = true; } else { pnlBrowseFiles.Enabled = false; } if (fmCurrent.DB.FileXRef.Select("LinkType=1").Length > 0 || fmCurrent.DB.FileXRef.Select("LinkType=2 and fileid=" + fmCurrent.CurrentFileId).Length > 0) { pnlXRefs.Enabled = true; } else { pnlXRefs.Enabled = false; } SetTooltipsForLinks(); SetFileStatusColor(fmCurrent.CurrentFile.StatusCode); officeDB.OfficeRow orOwnerOffice = null; try { orOwnerOffice = fmCurrent.AtMng.GetOffice(fmCurrent.CurrentFile.OwnerOfficeId).CurrentOffice; lnkJumpToOwnerFile.Tag = orOwnerOffice.OfficeFileId; lnkJumpToOwnerFile.Enabled = (orOwnerOffice.OfficeFileId != fileId); } catch (Exception xoo) { lnkJumpToOwnerFile.Enabled = false; } officeDB.OfficeRow orLeadOffice = null; if (!fmCurrent.CurrentFile.IsLeadOfficeIdNull()) { try { orLeadOffice = fmCurrent.AtMng.GetOffice(fmCurrent.CurrentFile.LeadOfficeId).CurrentOffice; lnkJumpToLeadFile.Visible = true; lnkJumpToLeadFile.Tag = orLeadOffice.OfficeFileId; lnkJumpToLeadFile.Enabled = (orLeadOffice.OfficeFileId != fileId); } catch (Exception xlo) { lnkJumpToLeadFile.Enabled = false; } } else { lnkJumpToLeadFile.Visible = false; } if (!fmCurrent.CurrentFile.IsFullFileNumberNull()) { lblFullNumberValue.Text = fmCurrent.CurrentFile.FullFileNumber; } else { lblFullNumberValue.Text = ""; } lblFilenameValue.Text = fmCurrent.CurrentFile.Name; atriumDB.ActivityRow ar = fmCurrent.GetActivity().GetCurrentCaseStatus(DateTime.Today.AddDays(100)); int csId = 0; if (ar != null) { csId = ar.CaseStatusId; lblStatusDateValue.Text = ar.ActivityDate.ToString("yyyy/MM/dd"); } else { lblStatusDateValue.Text = "N/A"; } // WI 75873 DataRow drProgram = null; if (programId > 0) { DataTable dt = Atmng.GetFile().Codes("Dim2"); DataRow[] dr = dt.Select("ProgramId = " + programId.ToString()); drProgram = dr[0]; appDB.ddLookupRow dlr = (appDB.ddLookupRow)Atmng.DB.ddLookup.Select("LookupName='Dim2'")[0]; lblProgram.Text = dlr["Description" + Atmng.AppMan.Language].ToString(); } else { lblProgram.Visible = false; lblProgramValue.Visible = false; pnlDockTop.Height -= defaultRowHeight; } // -- End // WI 75873 //Shared Folder START lblSharedFolder.Visible = false; lnkSharedFolder.Visible = false; string sharedPath = string.Empty; if (programId == 3) { sharedPath = Atmng.GetSetting(AppStringSetting.DataExchangeNetworkPath) + fmCurrent.CurrentFile.FullFileNumber.Replace("-", @"\"); } else if (programId == 2) { sharedPath = Atmng.GetSetting(AppStringSetting.ISDataExchangeNetworkPath) + fmCurrent.CurrentFile.FullFileNumber.Replace("-", @"\"); } if (sharedPath != string.Empty && System.IO.Directory.Exists(sharedPath)) { lnkSharedFolder.Text = sharedPath; lblSharedFolder.Visible = true; lnkSharedFolder.Visible = true; } else { pnlDockTop.Height -= defaultRowHeight; } //Shared Folder END lblTypeValue.Text = fmCurrent.AtMng.CodeDB.FileType.FindByFileTypeCode(fmCurrent.CurrentFile.FileType)["FileTypeDesc" + Atmng.AppMan.languageCamel].ToString(); lblStatusValue.Text = fmCurrent.AtMng.CodeDB.Status.FindByStatusCode(fmCurrent.CurrentFile.StatusCode)["StatusDesc" + Atmng.AppMan.languageCamel].ToString(); lblCaseStatusValue.Text = fmCurrent.AtMng.CodeDB.CaseStatus.FindByCaseStatusId(csId)["CaseStatusDesc" + Atmng.AppMan.languageCamel].ToString(); if (drProgram != null) { lblProgramValue.Text = (string)drProgram["ProgramDescription" + Atmng.AppMan.languageCamel].ToString(); } if (orOwnerOffice != null) { setOfficeTooltip(lnkJumpToOwnerFile, orOwnerOffice); } if (orLeadOffice != null) { setOfficeTooltip(lnkJumpToLeadFile, orLeadOffice); } //CLAS if (fmCurrent.GetCLASMng() != null && !fmCurrent.CurrentFile.IsOpponentIDNull()) { lmDatasets.CLAS.DebtorRow orDB = fmCurrent.GetCLASMng().GetDebtor().FindLoad(fmCurrent.CurrentFile.OpponentID); if (!orDB.IsNull("SIN")) { lblSINValue.Text = atriumBE.DebtorBE.FormattedSIN(orDB.SIN); } else { lblSINValue.Text = ""; } lnkSINLabel.Visible = true; lblSINValue.Visible = true; if (!fmCurrent.CurrentFile.IsLeadParalegalIDNull()) { lmDatasets.officeDB.OfficerRow orPL = fmCurrent.AtMng.GetOffice(fmCurrent.CurrentFile.OwnerOfficeId).GetOfficer().FindLoad(fmCurrent.CurrentFile.LeadParalegalID); lblParaLegalValue.Text = orPL.LastName + ", " + orPL.FirstName + " (" + orPL.OfficerCode + ")"; lblParalegal.Visible = true; lblParaLegalValue.Visible = true; } else { lblParaLegalValue.Text = ""; lblParalegal.Visible = false; lblParaLegalValue.Visible = false; } } else { //no CLAS; hide row lnkSINLabel.Visible = false; lblSINValue.Visible = false; lblParalegal.Visible = false; lblParaLegalValue.Visible = false; pnlDockTop.Height -= defaultRowHeight; } ParentFile.uiPanel0.Text = fmCurrent.CurrentFile.Name; ucBrowse1.FileContextMenu.UsedInTreeView = false; if (fmCurrent.CurrentFile.FileStructXml != null) { tvContents.Nodes.Clear(); System.Xml.XmlDocument xdToc = new System.Xml.XmlDocument(); xdToc.InnerXml = fmCurrent.CurrentFile.FileStructXml; LoadTOCNode(tvContents.Nodes, xdToc.DocumentElement); tvContents.ExpandAll(); tvContents.Nodes[0].EnsureVisible(); } }