Example #1
0
        /// <summary>
        /// Import Prospect
        /// </summary>
        /// <returns></returns>
        private int ImportProspect(int iContactID)
        {
            BLL.Prospect   bProspect = new BLL.Prospect();
            Model.Prospect mProspect = new Model.Prospect();

            mProspect.LeadSource    = this.sLeadSource;
            mProspect.ReferenceCode = this.sReferenceCode;
            mProspect.Contactid     = iContactID;
            mProspect.Status        = "Active";
            mProspect.Created       = DateTime.Now;
            mProspect.CreatedBy     = CurrUser.iUserID;
            mProspect.Loanofficer   = Convert.ToInt32(iLoanOfficer);

            return(bProspect.Add(mProspect));
        }
Example #2
0
        private void ExportClients(string IDs)
        {
            try
            {
                BLL.Prospect _bllProspect = new BLL.Prospect();
                DataTable    dt           = new DataTable();

                int recordCount = 0;

                string strWhere = isAll == true ? queryCondition : " Contactid in(" + IDs + ")";

                DataSet Lists = _bllProspect.GetList(recordTotal, 1, strWhere, out recordCount, "Contactid", 0);
                if (recordCount > 0)
                {
                    dt = Lists.Tables[0];
                }

                List <string> ShowColumnsList   = ShowColumnsForClients();
                List <string> NoShowColumnsList = new List <string>();

                foreach (DataColumn item in dt.Columns)
                {
                    if (ShowColumnsList.Contains(item.ColumnName))
                    {
                        item.Caption = item.ColumnName;
                    }
                    else
                    {
                        NoShowColumnsList.Add(item.ColumnName);
                    }
                }

                foreach (string item in NoShowColumnsList)
                {
                    dt.Columns.Remove(dt.Columns[item]);
                }



                Common.XlsExporter.DownloadXls(this.Page, dt, "Clients Pipeline Report.xls", "Clients Pipeline Report");
            }
            catch (Exception ex)
            {
            }
        }
Example #3
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;
                        }
                    }
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                BLL.Prospect bProspect       = new BLL.Prospect();
                string       sContactID      = Request.QueryString["contactID"];
                int          iContactID      = 0;
                bool         loantaskID_null = false;

                if (string.IsNullOrEmpty(sContactID))
                {
                    return;
                }


                if (int.TryParse(sContactID, out iContactID))
                {
                    try
                    {
                        hfdFileId.Value = iContactID.ToString();

                        dt = bProspect.GetTaskAlertDetail(iContactID);

                        if (dt == null || dt.Rows.Count < 1)
                        {
                            PageCommon.WriteJs(this, "", "window.parent.closeDialog();");
                            return;
                        }

                        string taskIds = "";
                        foreach (DataRow row in dt.Rows)
                        {
                            taskIds += row["ProspectTaskId"] + ",";
                        }
                        hfdAllTaskIds.Value = taskIds.TrimEnd(',');
                        //Get task id based on task table(when loan task id is null and file id not null)
                        if (dt.Rows.Count > 0)
                        {
                            hfdTaskId.Value = dt.Rows[0]["ProspectTaskId"].ToString();
                        }

                        LoginUser CurrentUser = new LoginUser();

                        if (!CurrentUser.userRole.SendEmail)
                        {
                            btnSendEmail.Enabled = false;
                        }

                        #region alex

                        //Get Task Owner and Current User's Make Others' Task Complate Power  by Alex 2011-01-22
                        string sTaskOwner = dt.Rows[0]["Owner"].ToString();
                        hdnTaskOwner.Text         = sTaskOwner;
                        hdnLoginUserID.Value      = CurrentUser.sFullName;
                        hdnMakeOtherTaskComp.Text = CurrentUser.userRole.MarkOtherTaskCompl == true ? "1" : "0";

                        #endregion

                        fvTaskAlertDetail.DataSource = dt;
                        fvTaskAlertDetail.DataBind();
                    }
                    catch (Exception exception)
                    {
                        LPLog.LogMessage(exception.Message);
                        return;
                    }
                }
            }
        }