示例#1
0
 public override System.Collections.Generic.List <int> Accounts(int id)
 {
     CLAS.AccountHistoryRow ahr = myAccountHistoryDT.FindByAccountHistoryId(id);
     System.Collections.Generic.List <int> l = new System.Collections.Generic.List <int>();
     l.Add(ahr.FileAccountID);
     return(l);
 }
示例#2
0
 protected override void BeforeUpdate(DataRow ddr)
 {
     CLAS.AccountHistoryRow dr = (CLAS.AccountHistoryRow)ddr;
     if (this.myA.GetFileHistory().GetCurrentRow().Length != 0)
     {
         if (((CLAS.FileHistoryRow) this.myA.GetFileHistory().GetCurrentRow()[0]).IsReceivedByOfficeDateNull())
         {
             if (!dr.IsReceivedByOfficeDateNull())
             {
                 throw new AtriumException(Resources.FileNotReceived);
             }
         }
     }
     if (dr.IsReceivedByOfficeDateNull())
     {
         CLAS.DebtRow cddr = myA.DB.Debt.FindByDebtId(dr.FileAccountID);
         cddr.OfficeID = dr.OfficeId;
     }
 }
示例#3
0
        protected override void AfterAdd(DataRow ddr)
        {
            CLAS.AccountHistoryRow dr = (CLAS.AccountHistoryRow)ddr;
            string ObjectName         = this.myAccountHistoryDT.TableName;

            if (dr.IsNull("AccountHistoryId"))
            {
                dr.AccountHistoryId = this.myA.AtMng.PKIDGet(ObjectName, 1);
            }

            if (dr.DebtRow == null)
            {
                throw new AtriumException(Resources.NoAccount);
            }
            dr.FileAccountID    = dr.DebtRow.FileAccountId;
            dr.FileId           = dr.DebtRow.FileId;
            dr.StatusCode       = dr.DebtRow.StatusCode;
            dr.SentToOfficeDate = DateTime.Today;
            dr.OfficeId         = dr.DebtRow.OfficeID;
            dr.FileHistoryId    = ((CLAS.FileHistoryRow) this.myA.GetFileHistory().GetCurrentRow()[0]).HistoryId;
        }
示例#4
0
        protected override void BeforeChange(DataColumn dc, DataRow ddr)
        {
            string ObjectName = this.myAccountHistoryDT.TableName;

            CLAS.AccountHistoryRow dr = (CLAS.AccountHistoryRow)ddr;
            switch (dc.ColumnName)
            {
            case "SentToOfficeDate":
                if (dr.IsSentToOfficeDateNull())
                {
                    throw new RequiredException(Resources.AccountHistorySentToOfficeDate);
                }
                //					if(dr.DebtRow.IsReceivedByJusticeDateNull())
                //						this.myA.RaiseError((int)AtriumEnum.AppErrorCodes.RelatedDateRequired, myA.GetLabelLeft(ObjectName, dc.ColumnName), myA.GetLabelLeft("FileAccount", "ReceivedByJusticeDate"));
                myA.IsValidDate(Resources.AccountHistorySentToOfficeDate, dr.SentToOfficeDate, false, dr.DebtRow.ReceivedByJusticeDate, DateTime.Today.AddDays(7), Resources.DebtReceivedByJusticeDate, Resources.ValidationSevenDaysLater);
                break;

            case "ReceivedByOfficeDate":
//					if(dr.IsReceivedByOfficeDateNull())
//						this.myA.RaiseError((int)AtriumEnum.AppErrorCodes.CannotBeBlank, myA.GetLabelLeft(ObjectName, dc.ColumnName));
                if (dr.IsSentToOfficeDateNull())
                {
                    throw new RelatedException(Resources.AccountHistoryReceivedByOfficeDate, Resources.AccountHistorySentToOfficeDate);
                }
                if (!dr.IsReceivedByOfficeDateNull())
                {
                    myA.IsValidDate(Resources.AccountHistoryReceivedByOfficeDate, dr.ReceivedByOfficeDate, true, dr.SentToOfficeDate, DateTime.Today, Resources.AccountHistorySentToOfficeDate, Resources.ValidationToday);
                }
                break;

            case "ReturnedByOfficeDate":
                if (dr.IsReceivedByOfficeDateNull())
                {
                    throw new AtriumException(Resources.AccountNotReceived);
                    //this.myA.RaiseError((int)AtriumEnum.AppErrorCodes.CannotBeBlank, myA.GetLabelLeft(ObjectName, dc.ColumnName));
                }
//					if(dr.IsReceivedByOfficeDateNull())
//						this.myA.RaiseError((int)AtriumEnum.AppErrorCodes.RelatedDateRequired,myA.GetLabelLeft(ObjectName, dc.ColumnName),myA.GetLabelLeft(ObjectName, "ReceivedByOfficeDate"));
                if (!dr.IsReturnedByOfficeDateNull())
                {
                    myA.IsValidDate(Resources.AccountHistoryReturnedByOfficeDate, dr.ReturnedByOfficeDate, true, dr.ReceivedByOfficeDate, DateTime.Today, Resources.AccountHistoryReceivedByOfficeDate, Resources.ValidationToday);
                }
                break;

            case "ReceivedFromOfficeDate":
                //					if(dr.IsReceivedFromOfficeDateNull())
                //						this.myA.RaiseError((int)AtriumEnum.AppErrorCodes.CannotBeBlank, myA.GetLabelLeft(ObjectName, dc.ColumnName));
                if (dr.IsReceivedByOfficeDateNull())
                {
                    throw new RelatedException(Resources.AccountHistoryReceivedFromOfficeDate, Resources.AccountHistoryReceivedByOfficeDate);
                }
                if (!dr.IsReceivedFromOfficeDateNull())
                {
                    myA.IsValidDate(Resources.AccountHistoryReceivedFromOfficeDate, dr.ReceivedFromOfficeDate, true, dr.ReturnedByOfficeDate, DateTime.Today, Resources.AccountHistoryReturnedByOfficeDate, Resources.ValidationToday);
                }
                break;

            case "OfficeId":
                if (dr.IsNull(dc))
                {
                    throw new RequiredException(Resources.OfficeID);
                }
                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 "StatusCode":
                if (!myA.CheckDomain(dr.StatusCode, myA.FM.Codes("status")))
                {
                    throw new AtriumException(atriumBE.Properties.Resources.BadDomainValue, dc.ColumnName, dc.Table.TableName, "Status Code");
                }
                break;
            //case "SubFileType":
            //    if (dr.IsNull(dc))
            //        myA.RaiseError((int)AtriumEnum.AppErrorCodes.CannotBeBlank, myA.GetLabelLeft(ObjectName, dc.ColumnName));
            //    else if (!myA.Codes("HistoryType").Rows.Contains(dr.SubFileType))
            //        myA.RaiseError((int)AtriumEnum.AppErrorCodes.FHInvalidFileType);
            //    break;

            default:
                break;
            }
        }
示例#5
0
        protected override void BeforeUpdate(DataRow row)
        {
            CLAS.FileHistoryRow dr = (CLAS.FileHistoryRow)row;
            //this.BeforeChange(dr.Table.Columns["SubFileType"], dr);
            this.BeforeChange(dr.Table.Columns["BillingCode"], dr);
            this.BeforeChange(dr.Table.Columns["SentToOfficeDate"], dr);
            this.BeforeChange(dr.Table.Columns["OfficeId"], dr);

            if (!dr.IsReceivedFromOfficeDateNull())
            {
                //update leadoffice to owner on efile
                bool demoteLead = false;
                if (myA.FM.CurrentFile.LeadOfficeId != myA.FM.CurrentFile.OwnerOfficeId)
                {
                    demoteLead = true;
                }

                myA.FM.CurrentFile.LeadOfficeId = myA.FM.CurrentFile.OwnerOfficeId;

                //demote leadoffice to ag
                if (demoteLead)
                {
                    this.myA.FM.GetFileOffice().AddOfficeToFile(dr.OfficeId, false, false, false);
                }

                //else
                //    this.myA.FM.GetFileOffice().AddOfficeToFile(dr.OfficeId, true, true, false);

                //set LeadOfficeContact endDate
                //atriumDB.FileContactRow[] LeadOfficeContact = (atriumDB.FileContactRow[])myA.FM.DB.FileContact.Select("ContactType='FLO'", "");
                //if (LeadOfficeContact.Length == 1)
                //    LeadOfficeContact[0].EndDate = DateTime.Today;

                //update secfilerule table
                //OfficeManager om = myA.FM.AtMng.GetOffice(dr.OfficeId);
                //atriumDB.secFileRuleRow[] secRule = (atriumDB.secFileRuleRow[])myA.FM.DB.secFileRule.Select("GroupId=" + om.CurrentOffice.DefaultGroup, "");
                //if (secRule.Length == 1)
                //{
                //    atriumDB.secFileRuleRow secRecord = secRule[0];
                //    secRecord.EndDate = atDates.StandardDate.NextQuarter.EndDate;

                //}
                //else
                //      throw new AtriumException("(OFFICEID: " + dr.OfficeId + ") - NO SECFILERULE RECORD WAS FOUND, OR THIS OFFICE HAS MULTIPLE SECFILERULE RECORDS.");
            }

            if (dr.RowState == DataRowState.Added)
            {
                this.myA.FM.GetFileOffice().AddOfficeToFile(dr.OfficeId, false, true, false);

                //AddUpdateLeadOfficeContact(dr);
                //AddSecFileRuleOnAssignment(dr);

                //for each fileaccount assign to this office
                AccountHistoryBE ahBE = this.myA.GetAccountHistory();

                foreach (CLAS.DebtRow far in this.myA.DB.Debt.Rows)
                {
                    if (far.AssignToAgent)
                    {
                        if (!far.ActiveWithJustice)
                        {
                            far.ActiveWithJustice = true; // if user selected account to assign, set active to true
                        }
                        CLAS.AccountHistoryRow ahr = (CLAS.AccountHistoryRow)ahBE.Add(far);
                        ahr.FileId           = myA.FM.CurrentFileId;
                        ahr.FileHistoryId    = dr.HistoryId;
                        ahr.OfficeId         = dr.OfficeId;
                        ahr.SentToOfficeDate = dr.SentToOfficeDate;
                    }
                }
            }
            else
            {
                //for each fileaccount assigned to this office
                foreach (CLAS.AccountHistoryRow ahr in myA.DB.AccountHistory.Select("FileHistoryId=" + dr.HistoryId.ToString()))
                {
                    if (ahr.IsReceivedFromOfficeDateNull() && ahr.DebtRow.ActiveWithJustice)
                    {
                        if (ahr.IsReceivedFromOfficeDateNull() && !dr.IsReceivedFromOfficeDateNull())
                        {
                            ahr.ReceivedFromOfficeDate = dr.ReceivedFromOfficeDate;
                        }

                        if (ahr.IsReturnedByOfficeDateNull() && !dr.IsReturnedByOfficeDateNull())
                        {
                            if (ahr.IsReceivedByOfficeDateNull())
                            {
                                throw new AtriumException(Resources.AccountNotReceived);
                            }
                            ahr.ReturnedByOfficeDate = dr.ReturnedByOfficeDate;
                        }

                        if (ahr.IsReceivedByOfficeDateNull() && !dr.IsReceivedByOfficeDateNull())
                        {
                            ahr.ReceivedByOfficeDate = dr.ReceivedByOfficeDate;
                        }

                        if (ahr.IsReturnCodeNull() && !dr.IsReturnCodeNull())
                        {
                            ahr.ReturnCode = dr.ReturnCode;
                        }
                    }
                }
            }
        }
示例#6
0
 private void accountHistoryBindingSource_CurrentChanged(object sender, EventArgs e)
 {
     uiTabPage2.Enabled = true;
     CLAS.AccountHistoryRow cbr = CurrentRowAccountHistory();
     ApplyHistorySecurity(cbr);
 }