Пример #1
0
        private void ShowInfo(int _id)
        {
            BLL.Contacts   bll   = new BLL.Contacts();
            Model.Contacts model = bll.GetModel(_id);

            txtName.Text  = model.co_name;
            txtPhone.Text = model.co_number;
            if (model.co_flag.Value)
            {
                labflag.Text = "主要联系人";
            }
        }
Пример #2
0
 /// <summary>
 /// Load prospect detail info
 /// </summary>
 private void LoadProspectData()
 {
     LPWeb.Model.Prospect prospectModel = new Model.Prospect();
     try
     {
         //prospect detail info
         prospectModel = this.prospectMgr.GetModel(iProspectID);
         BLL.Contacts         contactMgr   = new BLL.Contacts();
         LPWeb.Model.Contacts contactModel = contactMgr.GetModel(prospectModel.Contactid);
         this.lbProspect.Text = contactModel.LastName + ", " + contactModel.FirstName + " " + contactModel.MiddleName;
         this.lbSSN.Text      = (contactModel.SSN.Length > 7 ? "xxx-xx-" + contactModel.SSN.Substring(7) : contactModel.SSN);
         if (contactModel.DOB != null && Convert.ToDateTime(contactModel.DOB).Year != 1900)
         {
             this.lbDOB.Text = Convert.ToDateTime(contactModel.DOB).ToString("MM/dd/yyyy");
         }
         this.lbAddress.Text = contactModel.MailingAddr + ", " + contactModel.MailingCity + ", " + contactModel.MailingState + ", " + contactModel.MailingZip;
         BLL.Users userMgr = new BLL.Users();
         if (prospectModel.Loanofficer != null)
         {
             Model.Users userModel = userMgr.GetModel(Convert.ToInt32(prospectModel.Loanofficer));
             if (userModel != null)
             {
                 this.lbLoanOfficer.Text = userModel.LastName + ", " + userModel.FirstName;
             }
         }
         //search info
         if (this.Request.QueryString["Type"] == null)
         {
             if (contactModel.LastName.Trim() != "")
             {
                 this.tbxBrwLastName.Text = contactModel.LastName;
             }
             if (contactModel.FirstName.Trim() != "")
             {
                 this.tbxBrwFirstName.Text = contactModel.FirstName;
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #3
0
        private void BindInfo()
        {
            int id = Convert.ToInt32(Request.QueryString["id"]);

            Model.Contacts modelcon = bllcon.GetModel(id);
            cName.Value               = modelcon.cName;
            Sex.SelectedValue         = Convert.ToInt32(modelcon.Sex).ToString();
            Bearthday.Value           = modelcon.Bearthday.ToString();
            Appellation.SelectedValue = Convert.ToInt32(modelcon.Appellation).ToString();
            department.SelectedValue  = Convert.ToInt32(modelcon.department).ToString();
            officPhone.Value          = modelcon.officPhone;
            Phone.Value               = modelcon.Phone;
            Address.Value             = modelcon.Address;
            zipcode.Value             = modelcon.zipcode;
            Mail.Value         = modelcon.Mail;
            Post.SelectedValue = modelcon.Post.ToString();
            familyPhone.Value  = modelcon.familyPhone;
            Likes.Value        = modelcon.Likes;
            Remark.Value       = modelcon.Remark;
        }
Пример #4
0
        private string DoEdit(int _id)
        {
            BLL.Contacts   bll   = new BLL.Contacts();
            Model.Contacts model = bll.GetModel(_id);
            manager = GetAdminInfo();
            string _content = string.Empty;

            model.co_cid = cid;
            if (model.co_name != txtName.Text.Trim())
            {
                _content += "联系人:" + model.co_name + "→<font color='red'>" + txtName.Text.Trim() + "<font><br/>";
            }
            model.co_name = txtName.Text.Trim();
            if (model.co_number != txtPhone.Text.Trim())
            {
                _content += "联系号码:" + model.co_number + "→<font color='red'>" + txtPhone.Text.Trim() + "<font><br/>";
            }
            model.co_number = txtPhone.Text.Trim();
            return(bll.Update(model, manager, _content));
        }
Пример #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (ContactId.HasValue)
     {
         BLL.Contacts   ContactsManager = new BLL.Contacts();
         Model.Contacts contact         = ContactsManager.GetModel(ContactId.Value);
         if (null != contact && null != contact.Picture)
         {
             Response.BinaryWrite(contact.Picture);
         }
         else
         {
             ResponseDefaultPicture();
         }
     }
     else
     {
         ResponseDefaultPicture();
     }
     Response.End();
 }
Пример #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.btnPreWarn.OnClientClick = string.Format("return previewEmailTemplate('{0}');", this.ddlWarningEmail.ClientID);
                this.btnPreOverdue.OnClientClick = string.Format("return previewEmailTemplate('{0}');", this.ddlOverdueEmail.ClientID);
                this.btnPreComple.OnClientClick = string.Format("return previewEmailTemplate('{0}');", this.ddlComleEmail.ClientID);

                // bind email template
                BLL.Template_Email emailTpltManager = new BLL.Template_Email();

                DataTable dtEmailTplts = emailTpltManager.GetEmailTemplate("");
                this.ddlWarningEmail.DataValueField = "TemplEmailId";
                this.ddlWarningEmail.DataTextField = "Name";
                this.ddlWarningEmail.DataSource = dtEmailTplts;
                this.ddlWarningEmail.DataBind();
                this.ddlWarningEmail.Items.Insert(0, new ListItem("--select an email template--", "0"));

                this.ddlOverdueEmail.DataValueField = "TemplEmailId";
                this.ddlOverdueEmail.DataTextField = "Name";
                this.ddlOverdueEmail.DataSource = dtEmailTplts;
                this.ddlOverdueEmail.DataBind();
                this.ddlOverdueEmail.Items.Insert(0, new ListItem("--select an email template--", "0"));

                this.ddlComleEmail.DataValueField = "TemplEmailId";
                this.ddlComleEmail.DataTextField = "Name";
                this.ddlComleEmail.DataSource = dtEmailTplts;
                this.ddlComleEmail.DataBind();
                this.ddlComleEmail.Items.Insert(0, new ListItem("--select an email template--", "0"));

                BindTaskOwner();

                if ("0" == Mode)
                {
                    BLL.Prospect prospectManager = new BLL.Prospect();
                    Model.Prospect currProspect = prospectManager.GetModel(ContactId.GetValueOrDefault(0));
                    if (null == currProspect)
                    {
                        this.ClientScript.RegisterClientScriptBlock(this.GetType(), "_Invalid3", "alert('Invalid query string.');window.close();", true);
                        return;
                    }
                    // set prospect's officer as task owner
                    ListItem listItem = this.ddlOwner.Items.FindByValue(currProspect.Loanofficer.GetValueOrDefault(0).ToString());
                    if (null != listItem)
                        listItem.Selected = true;
                    
                    this.btnDelete.Enabled = false;
                    this.btnClone.Enabled = false;

                    int nContactId = -1;
                    if (!int.TryParse(Request.QueryString["ContactId"], out nContactId))
                        nContactId = -1;
                    Model.Contacts contact = contactsManager.GetModel(nContactId);
                    if (null != contact)
                        this.lblClient.Text = string.Format("{0}, {1} {2}", contact.LastName, contact.FirstName, contact.MiddleName);
                    else
                    {
                        PageCommon.AlertMsg(this, "Invalid contact id!");
                        ClientFun("closewindow", "closeBox(false, false);");
                    }
                }
                else if ("1" == Mode)
                {
                    if (!ProspectTaskId.HasValue)
                    {
                        // if no ProspectTaskId,thorw exception
                        LPLog.LogMessage(LogType.Logerror, "Invalid client task id");
                        throw new Exception("Invalid client task id");
                    }
                    else
                    {
                        Model.ProspectTasks pt = ptManager.GetModel(ProspectTaskId.Value);
                        if (null == pt)
                        {
                            LPLog.LogMessage(LogType.Logerror, string.Format("Cannot find the task with ID:{0}", ProspectTaskId.Value));
                        }
                        else
                        {
                            if (pt.Completed.HasValue)
                            {
                                this.btnSave.Enabled = false;
                                this.btnDelete.Enabled = false;
                            }
                            Model.Contacts contact = contactsManager.GetModel(pt.ContactId);
                            if (null != contact)
                                this.lblClient.Text = string.Format("{0}, {1} {2}", contact.LastName, contact.FirstName, contact.MiddleName);
                            this.tbTaskName.Text = pt.TaskName;
                            this.ckbEnabled.Checked = pt.Enabled;
                            this.tbDesc.Text = pt.Desc;
                            ListItem listTaskItem = this.ddlOwner.Items.FindByValue(pt.OwnerId.GetValueOrDefault(0).ToString());
                            if (null != listTaskItem)
                                listTaskItem.Selected = true;
                            this.ddlOwner.SelectedIndex = pt.OwnerId.GetValueOrDefault();
                            if (pt.Due.HasValue)
                                this.tbDue.Text = pt.Due.Value.ToString("MM/dd/yyyy");

                            ListItem listItem = this.ddlWarningEmail.Items.FindByValue(pt.WarningEmailTemplId.GetValueOrDefault().ToString());
                            if (null != listItem)
                                listItem.Selected = true;

                            listItem = this.ddlOverdueEmail.Items.FindByValue(pt.OverdueEmailTemplId.GetValueOrDefault().ToString());
                            if (null != listItem)
                                listItem.Selected = true;

                            listItem = this.ddlComleEmail.Items.FindByValue(pt.CompletionEmailTemplid.GetValueOrDefault().ToString());
                            if (null != listItem)
                                listItem.Selected = true;
                        }
                    }
                }
            }
        }