Example #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
        { }
    }
Example #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);
    }
Example #3
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <LPWeb.Model.LoanAutoEmails> DataTableToList(DataTable dt)
        {
            List <LPWeb.Model.LoanAutoEmails> modelList = new List <LPWeb.Model.LoanAutoEmails>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                LPWeb.Model.LoanAutoEmails model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new LPWeb.Model.LoanAutoEmails();
                    if (dt.Rows[n]["LoanAutoEmailid"].ToString() != "")
                    {
                        model.LoanAutoEmailid = int.Parse(dt.Rows[n]["LoanAutoEmailid"].ToString());
                    }
                    if (dt.Rows[n]["FileId"].ToString() != "")
                    {
                        model.FileId = int.Parse(dt.Rows[n]["FileId"].ToString());
                    }
                    if (dt.Rows[n]["ToContactId"].ToString() != "")
                    {
                        model.ToContactId = int.Parse(dt.Rows[n]["ToContactId"].ToString());
                    }
                    if (dt.Rows[n]["ToUserId"].ToString() != "")
                    {
                        model.ToUserId = int.Parse(dt.Rows[n]["ToUserId"].ToString());
                    }
                    if (dt.Rows[n]["Enabled"].ToString() != "")
                    {
                        if ((dt.Rows[n]["Enabled"].ToString() == "1") || (dt.Rows[n]["Enabled"].ToString().ToLower() == "true"))
                        {
                            model.Enabled = true;
                        }
                        else
                        {
                            model.Enabled = false;
                        }
                    }
                    if (dt.Rows[n]["External"].ToString() != "")
                    {
                        if ((dt.Rows[n]["External"].ToString() == "1") || (dt.Rows[n]["External"].ToString().ToLower() == "true"))
                        {
                            model.External = true;
                        }
                        else
                        {
                            model.External = false;
                        }
                    }
                    if (dt.Rows[n]["TemplReportId"].ToString() != "")
                    {
                        model.TemplReportId = int.Parse(dt.Rows[n]["TemplReportId"].ToString());
                    }
                    if (dt.Rows[n]["Applied"].ToString() != "")
                    {
                        model.Applied = DateTime.Parse(dt.Rows[n]["Applied"].ToString());
                    }
                    if (dt.Rows[n]["AppliedBy"].ToString() != "")
                    {
                        model.AppliedBy = int.Parse(dt.Rows[n]["AppliedBy"].ToString());
                    }
                    if (dt.Rows[n]["LastRun"].ToString() != "")
                    {
                        model.LastRun = DateTime.Parse(dt.Rows[n]["LastRun"].ToString());
                    }
                    if (dt.Rows[n]["ScheduleType"].ToString() != "")
                    {
                        model.ScheduleType = int.Parse(dt.Rows[n]["ScheduleType"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Example #4
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(LPWeb.Model.LoanAutoEmails model)
 {
     dal.Update(model);
 }
Example #5
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(LPWeb.Model.LoanAutoEmails model)
 {
     return(dal.Add(model));
 }
Example #6
0
 public void UpdateEmailSettings(LPWeb.Model.LoanAutoEmails model)
 {
     dal.UpdateEmailSettings(model);
 }