示例#1
0
    private void UpdateEmailSettings(int ContactID, int UserID, int ScheduleType, bool Enabled, int iTempReportID)
    {
        LPWeb.Model.LoanAutoEmails model = new LPWeb.Model.LoanAutoEmails();
        model.FileId       = this.iLoanID;
        model.Enabled      = Enabled;
        model.ScheduleType = ScheduleType;
        model.ToContactId  = ContactID;
        model.ToUserId     = UserID;
        model.Applied      = DateTime.Now;
        model.AppliedBy    = this.CurrentUser.iUserID;
        if (ContactID != 0 && UserID == 0)
        {
            model.External = true;
        }
        else
        {
            model.External = false;
        }
        if (iTempReportID != 0)
        {
            model.TemplReportId = 1;
        }

        try
        {
            LPWeb.BLL.LoanAutoEmails bll = new LPWeb.BLL.LoanAutoEmails();
            bll.UpdateEmailSettings(model);
        }
        catch
        { }
    }
示例#2
0
    private int SaveLoanAutoEmailid(int FileId, int TemplReportId, int ToContactId, int ToUserId, bool External)
    {
        LPWeb.BLL.LoanAutoEmails bll = new LPWeb.BLL.LoanAutoEmails();

        int LoanAutoEmailId = bll.GetLoanAutoEmailIdByContactUserId(FileId, ToUserId, ToContactId);

        LPWeb.Model.LoanAutoEmails model = new LPWeb.Model.LoanAutoEmails();
        // model.LoanAutoEmailid
        model.Enabled       = true;
        model.External      = External;
        model.FileId        = FileId;
        model.ScheduleType  = 0;
        model.TemplReportId = TemplReportId;
        model.ToContactId   = ToContactId;
        model.ToUserId      = ToUserId;
        model.Applied       = DateTime.Now;
        model.LastRun       = null;
        if (LoanAutoEmailId <= 0)
        {
            model.LoanAutoEmailid = bll.Add(model);
        }
        else
        {
            model.LoanAutoEmailid = LoanAutoEmailId;
        }
        return(model.LoanAutoEmailid);
    }