Ejemplo n.º 1
0
        //批量删除
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            //ChkAdminLevel("sys_customer_list", DTEnums.ActionEnum.Delete.ToString()); //检查权限
            BLL.Contacts bll    = new BLL.Contacts();
            string       result = "";

            log = new Model.business_log();
            string        idstr = string.Empty;
            int           success = 0, error = 0;
            StringBuilder sb = new StringBuilder();

            for (int i = 0; i < rptList.Items.Count; i++)
            {
                int      id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
                CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
                if (cb.Checked)
                {
                    result = bll.Delete(Convert.ToInt32(id), manager);
                    if (result == "")
                    {
                        success++;
                    }
                    else
                    {
                        error++;
                        sb.Append(result + "<br/>");
                    }
                }
            }
            JscriptMsg("共选择" + (success + error) + "条记录,成功" + success + "条,失败" + error + "条<br/>" + sb.ToString(), "customer_edit.aspx?action=" + action + "&id=" + this.id);
        }
Ejemplo n.º 2
0
 private string DoAdd()
 {
     Model.Contacts model = new Model.Contacts();
     BLL.Contacts   bll   = new BLL.Contacts();
     manager         = GetAdminInfo();
     model.co_cid    = cid;
     model.co_flag   = false;
     model.co_name   = txtName.Text.Trim();
     model.co_number = txtPhone.Text.Trim();
     return(bll.Add(model, manager));
 }
Ejemplo n.º 3
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 = "主要联系人";
            }
        }
Ejemplo n.º 4
0
        private void BindPage(int fileId)
        {
            BLL.Loans bllLoans = new BLL.Loans();

            Model.Loans  modelLoan  = new Model.Loans();
            BLL.Contacts bllContact = new BLL.Contacts();
            BLL.Users    bllUser    = new BLL.Users();

            modelLoan = bllLoans.GetModel(fileId);
            if (modelLoan != null && modelLoan.RateLockExpiration != null)
            {
                lblRateLockExp.Text = modelLoan.RateLockExpiration.Value.ToShortDateString();
                hfdExpDate.Value    = modelLoan.RateLockExpiration.Value.ToOADate().ToString();
            }

            lblCurrentState.Text = bllLoans.GetLoanStage(fileId);

            lblBorrower.Text = bllContact.GetBorrower(fileId);

            if (modelLoan != null)
            {
                lblEstCloseDate.Text = modelLoan.EstCloseDate != null?modelLoan.EstCloseDate.Value.ToShortDateString() : string.Empty;
            }

            lblCoborrower.Text = bllContact.GetCoBorrower(fileId);

            lblLoanOfficer.Text = bllUser.GetLoanOfficer(fileId);

            if (modelLoan != null)
            {
                lblPropertyAddress.Text = modelLoan.PropertyAddr + " " + modelLoan.PropertyCity + " " + modelLoan.PropertyState + " " + modelLoan.PropertyZip;
            }

            if (modelLoan != null && modelLoan.LoanAmount.HasValue)
            {
                lblLoanAmount.Text = "$" + string.Format("{0:N0}", modelLoan.LoanAmount.Value);
            }

            if (modelLoan != null && modelLoan.Rate.HasValue)
            {
                lblInterestRate.Text = modelLoan.Rate.Value.ToString("#.####") + "%";
            }

            lblLender.Text = bllLoans.GetLender(fileId);

            hfdFileId.Value = fileId.ToString();
        }
Ejemplo n.º 5
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;
     }
 }
Ejemplo n.º 6
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));
        }
Ejemplo n.º 7
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();
 }
Ejemplo n.º 8
0
        private void ShowInfo(string _oid)
        {
            rptEmployee0.Visible = false;
            liemployee0.Visible  = false;
            BLL.Order bll = new BLL.Order();
            DataSet   ds  = bll.GetList(0, "o_id='" + _oid + "'", "o_addDate desc");

            if (ds == null || ds.Tables[0].Rows.Count == 0)
            {
                JscriptMsg("订单不存在!", "");
                return;
            }
            DataRow dr = ds.Tables[0].Rows[0];

            labOwner.Text   = new MettingSys.BLL.department().getAreaText(dr["op_area"].ToString()) + "," + dr["op_number"] + "," + dr["op_name"];
            txtCusName.Text = dr["c_name"].ToString();
            hCusId.Value    = dr["c_id"].ToString();
            List <Model.Contacts> contactlist = new BLL.Contacts().getList("co_cid=" + hCusId.Value + "", " co_flag desc,co_id asc");

            if (contactlist != null)
            {
                ddlcontact.DataSource     = contactlist;
                ddlcontact.DataTextField  = "co_name";
                ddlcontact.DataValueField = "co_id";
                ddlcontact.DataBind();
            }
            ddlcontact.SelectedValue       = dr["o_coid"].ToString();
            txtPhone.Text                  = dr["co_number"].ToString();
            ddlcontractPrice.SelectedValue = dr["o_contractPrice"].ToString();
            txtsDate.Text                  = ConvertHelper.toDate(dr["o_sdate"]).Value.ToString("yyyy-MM-dd");
            txteDate.Text                  = ConvertHelper.toDate(dr["o_edate"]).Value.ToString("yyyy-MM-dd");
            txtAddress.Text                = dr["o_address"].ToString();
            txtContent.Text                = dr["o_content"].ToString();
            txtContract.Text               = dr["o_contractContent"].ToString();
            txtRemark.Text                 = dr["o_remarks"].ToString();
            ddlfStatus.SelectedValue       = dr["o_status"].ToString();
            //ddldstatus.SelectedValue = dr["o_dstatus"].ToString();
            ddlpushStatus.SelectedValue = dr["o_isPush"].ToString();
            labFlag.Text          = Common.BusinessDict.checkStatus()[Utils.ObjToByte(dr["o_flag"])];
            ddlflag.SelectedValue = dr["o_flag"].ToString();
            labLockStatus.Text    = Common.BusinessDict.lockStatus()[Utils.ObjToByte(dr["o_lockStatus"])];
            labfinanceCost.Text   = dr["o_financeCust"].ToString();
            txtCost.Text          = dr["o_financeCust"].ToString();
            finCost = Utils.StrToDecimal(dr["o_financeCust"].ToString(), 0);
            ddllockstatus.SelectedValue = dr["o_lockStatus"].ToString();
            labFinRemarks.Text          = dr["o_finRemarks"].ToString();
            txtFinRemark.Text           = dr["o_finRemarks"].ToString();
            labStatusTime.Text          = Utils.ObjectToStr(dr["o_statusTime"]) == "" ? "" : Utils.StrToDateTime(Utils.ObjectToStr(dr["o_statusTime"])).ToString("yyyy-MM-dd HH:mm:ss");

            #region 归属地
            string placeStr = dr["o_place"].ToString();
            if (!string.IsNullOrEmpty(placeStr))
            {
                Dictionary <string, string> areaDic      = new BLL.department().getAreaDict();
                Dictionary <string, string> orderAreaDic = new Dictionary <string, string>();
                string[] list = placeStr.Split(',');
                foreach (string item in list)
                {
                    if (areaDic.ContainsKey(item))
                    {
                        orderAreaDic.Add(item, areaDic[item]);
                    }
                }
                rptAreaList.DataSource = orderAreaDic;
                rptAreaList.DataBind();
            }
            #endregion

            #region 人员
            DataTable pdt = bll.GetPersonList(0, "op_oid='" + _oid + "'", "op_id asc").Tables[0];
            if (pdt != null && pdt.Rows.Count > 0)
            {
                rptEmployee1.DataSource = pdt.Select("op_type=2");
                rptEmployee1.DataBind();

                rptEmployee2.DataSource = pdt.Select("op_type=3");
                rptEmployee2.DataBind();

                rptEmployee3.DataSource = pdt.Select("op_type=4");
                rptEmployee3.DataBind();

                rptEmployee4.DataSource = pdt.Select("op_type=5");
                rptEmployee4.DataBind();

                liplace.Visible          = false;
                liemployee1.Visible      = false;
                liemployee2.Visible      = false;
                liemployee3.Visible      = false;
                liemployee4.Visible      = false;
                uploadDiv.Visible        = false;
                uploadDiv2.Visible       = false;
                btnSave.Visible          = false;
                btnDstatus.Visible       = false;
                btnFlag.Visible          = false;
                btnLockstatus.Visible    = false;
                btnUpdateCost.Visible    = false;
                btnUnBusinessPay.Visible = false;
                btnReceiptPay.Visible    = false;
                btnFinRemark.Visible     = false;
                //btnPay.Visible = false;
                btnInvoince.Visible = false;
                //btnExcelIn.Visible = false;
                btnSharing.Visible = false;
                trFile.Visible     = false;
                #region 根据当前登录账户显示不同按钮
                DataRow[] drs1       = pdt.Select("op_type=1 and op_number='" + manager.user_name + "'"); //业务员
                DataRow[] drs2       = pdt.Select("op_type=2 and op_number='" + manager.user_name + "'"); //业务报账人员
                DataRow[] drs3       = pdt.Select("op_type=3 and op_number='" + manager.user_name + "'"); //业务策划人员
                DataRow[] drs4       = pdt.Select("op_type=4 and op_number='" + manager.user_name + "'"); //业务执行人员
                DataRow[] drs6       = pdt.Select("op_type=5 and op_number='" + manager.user_name + "'"); //业务设计人员
                bool      showDetail = false;

                if (drs4.Length > 0)
                {
                    isExecutiver             = true;
                    showDetail               = true;
                    uploadDiv.Visible        = true;
                    btnUnBusinessPay.Visible = true;
                    btnReceiptPay.Visible    = true;
                    //btnPay.Visible = true;
                    btnInvoince.Visible = true;
                    //btnExcelIn.Visible = true;
                }
                if (drs3.Length > 0 || drs6.Length > 0)
                {
                    showDetail         = true;
                    uploadDiv.Visible  = true;
                    uploadDiv2.Visible = true;
                    btnDstatus.Visible = true;
                    trFile.Visible     = true;
                    if (drs3.Length > 0)
                    {
                        ddldstatus.SelectedValue = drs3[0]["op_dstatus"].ToString();
                    }
                    else if (drs6.Length > 0)
                    {
                        ddldstatus.SelectedValue = drs6[0]["op_dstatus"].ToString();
                    }
                }
                if (drs2.Length > 0)
                {
                    isExecutiver             = false;
                    showDetail               = true;
                    liplace.Visible          = true;
                    liemployee2.Visible      = true;
                    liemployee3.Visible      = true;
                    liemployee4.Visible      = true;
                    uploadDiv.Visible        = true;
                    uploadDiv2.Visible       = true;
                    btnUnBusinessPay.Visible = true;
                    btnReceiptPay.Visible    = true;
                    btnSave.Visible          = true;
                    //btnPay.Visible = true;
                    btnInvoince.Visible = true;
                    //btnExcelIn.Visible = true;
                    trFile.Visible = true;
                }
                if (drs1.Length > 0)
                {
                    isExecutiver             = false;
                    showDetail               = true;
                    liplace.Visible          = true;
                    liemployee1.Visible      = true;
                    liemployee2.Visible      = true;
                    liemployee3.Visible      = true;
                    liemployee4.Visible      = true;
                    uploadDiv.Visible        = true;
                    uploadDiv2.Visible       = true;
                    btnSave.Visible          = true;
                    btnUnBusinessPay.Visible = true;
                    btnReceiptPay.Visible    = true;
                    //btnPay.Visible = true;
                    btnInvoince.Visible = true;
                    //btnExcelIn.Visible = true;
                    trFile.Visible = true;
                }
                DataRow[] drs5 = pdt.Select("op_type=1");
                //判断是否含有查看本区域数据的权限
                if (new BLL.permission().checkHasPermission(manager, "0602") && (drs5[0]["op_area"].ToString() == manager.area || Utils.ObjectToStr(dr["o_place"]).IndexOf(manager.area) > -1))
                {
                    showDetail     = true;
                    trFile.Visible = true;
                }
                string groupArea = new BLL.department().getGroupArea();//总部

                //判断是否是本区域,且含有财务基本权限
                if ((drs5[0]["op_area"].ToString() == manager.area || groupArea == manager.area) && new BLL.permission().checkHasPermission(manager, "0401"))
                {
                    showDetail               = true;
                    trFile.Visible           = true;
                    btnUnBusinessPay.Visible = true;
                    btnReceiptPay.Visible    = true;
                    uploadDiv2.Visible       = true;
                    //btnPay.Visible = true;
                    btnInvoince.Visible = true;
                    //btnExcelIn.Visible = true;
                }
                //判断是否含有查看本区域审批权限
                if (drs5[0]["op_area"].ToString() == manager.area && new BLL.permission().checkHasPermission(manager, "0603"))
                {
                    trFile.Visible  = true;
                    showDetail      = true;
                    btnFlag.Visible = true;
                }
                //
                if (groupArea == manager.area)
                {
                    if (new BLL.permission().checkHasPermission(manager, "0401"))
                    {
                        showDetail     = true;
                        trFile.Visible = true;
                    }
                    if (new BLL.permission().checkHasPermission(manager, "0405"))
                    {
                        showDetail            = true;
                        btnLockstatus.Visible = true;
                        btnUpdateCost.Visible = true;
                        trFile.Visible        = true;
                    }
                }
                if (new BLL.permission().checkHasPermission(manager, "0401"))
                {
                    btnFinRemark.Visible = true;
                    if (!Utils.StrToBool(dr["o_lockStatus"].ToString(), false))
                    {
                        btnSharing.Visible = true;
                    }
                }
                //以上都没有权限的,不能查看订单详细
                if (!showDetail)
                {
                    string msgbox = "parent.jsdialog(\"错误提示\", \"您没有管理该页面的权限,请勿非法进入!\", \"back\")";
                    Response.Write("<script type=\"text/javascript\">" + msgbox + "</script>");
                    Response.End();
                }
                #endregion
            }
            #endregion

            if (dr["o_lockStatus"].ToString() == "1")
            {
                liplace.Visible          = false;
                liemployee1.Visible      = false;
                liemployee2.Visible      = false;
                liemployee3.Visible      = false;
                liemployee4.Visible      = false;
                uploadDiv.Visible        = false;
                uploadDiv2.Visible       = false;
                btnSave.Visible          = false;
                btnDstatus.Visible       = false;
                btnFlag.Visible          = false;
                btnUpdateCost.Visible    = false;
                btnUnBusinessPay.Visible = false;
                btnReceiptPay.Visible    = false;
                //btnPay.Visible = false;
                btnInvoince.Visible = true;
                //btnExcelIn.Visible = false;
            }

            #region 活动文件
            DataTable fdt = bll.GetFileList(0, "f_oid='" + _oid + "'", "f_addDate asc,f_id asc").Tables[0];
            if (fdt != null && fdt.Rows.Count > 0)
            {
                rptAlbumList.DataSource = fdt.Select("f_type=1");
                rptAlbumList.DataBind();

                rptAlbumList2.DataSource = fdt.Select("f_type=2");
                rptAlbumList2.DataBind();
            }
            #endregion

            string sqlwhere = "";
            #region 执行备用金借款明细
            if (isExecutiver)
            {
                sqlwhere = " and uba_PersonNum='" + manager.user_name + "'";
            }
            DataSet unBusinessData = new BLL.unBusinessApply().GetList(0, "uba_oid='" + _oid + "' " + sqlwhere + "", "uba_addDate desc,uba_id desc");
            if (unBusinessData != null && unBusinessData.Tables[0].Rows.Count > 0)
            {
                rptunBusinessList.DataSource = unBusinessData;
                rptunBusinessList.DataBind();
            }
            #endregion

            #region 应收付
            DataTable natureData = new BLL.finance().getNature(_oid, isExecutiver ? manager.user_name : "");
            if (natureData != null && natureData.Rows.Count > 0)
            {
                rptNature.DataSource = natureData;
                rptNature.DataBind();
            }

            #endregion

            #region 发票
            if (isExecutiver)
            {
                sqlwhere = " and inv_personNum='" + manager.user_name + "'";
            }
            DataTable invoiceData = new BLL.invoices().GetList(0, "inv_oid='" + _oid + "' " + sqlwhere + "", "inv_addDate desc,inv_id desc").Tables[0];
            if (invoiceData != null && invoiceData.Rows.Count > 0)
            {
                foreach (DataRow inv in invoiceData.Rows)
                {
                    if (inv["inv_flag1"].ToString() != "1" && inv["inv_flag2"].ToString() != "1" && inv["inv_flag3"].ToString() != "1")
                    {
                        requestMoney += Utils.StrToDecimal(inv["inv_money"].ToString(), 0);
                    }
                    if (Utils.StrToBool(inv["inv_isConfirm"].ToString(), false))
                    {
                        confirmMoney += Utils.StrToDecimal(inv["inv_money"].ToString(), 0);
                    }
                }
                rptInvoiceList.DataSource = invoiceData;
                rptInvoiceList.DataBind();
            }
            #endregion

            #region 已收付款
            if (isExecutiver)
            {
                sqlwhere = " and rpd_personNum='" + manager.user_name + "'";
            }
            DataTable rpData = new BLL.ReceiptPayDetail().GetList(0, "rpd_oid='" + _oid + "'", "rpd_type desc,rpd_adddate desc,rpd_id desc").Tables[0];
            if (rpData != null && rpData.Rows.Count > 0)
            {
                rptList.DataSource = rpData;
                rptList.DataBind();
            }
            #endregion

            #region 结算汇总
            if (!isExecutiver)//执行人员不可查看
            {
                DataTable collectData = bll.getOrderCollect(_oid);
                if (collectData != null && collectData.Rows.Count > 0)
                {
                    foreach (DataRow inv in collectData.Rows)
                    {
                        finProfit += Utils.StrToDecimal(inv["profit"].ToString(), 0);
                        if (inv["fin_type"].ToString() == "True")
                        {
                            fin1 += Utils.StrToDecimal(inv["finMoney"].ToString(), 0);
                        }
                        else
                        {
                            fin0 += Utils.StrToDecimal(inv["finMoney"].ToString(), 0);
                        }
                    }

                    rptCollect.DataSource = collectData;
                    rptCollect.DataBind();
                }
            }
            #endregion
        }
Ejemplo n.º 9
0
        private void BindPage(int fileId, int hisId)
        {
            BLL.Loans              bllLoans              = new BLL.Loans();
            Model.Loans            modelLoan             = new Model.Loans();
            BLL.Contacts           bllContact            = new BLL.Contacts();
            BLL.Users              bllUser               = new BLL.Users();
            BLL.PointImportHistory bllPointImportHistory = new PointImportHistory();
            BLL.PointFiles         bllPointFiles         = new PointFiles();
            BLL.PointFolders       bllPointFolders       = new PointFolders();

            var dsList = new DataSet();

            if (fileId > 0)
            {
                dsList = bllPointImportHistory.GetList(string.Format("FileId={0}", fileId));
            }
            else if (hisId > 0)
            {
                dsList = bllPointImportHistory.GetList(string.Format("HistoryId={0}", hisId));
            }

            if (dsList == null || dsList.Tables.Count == 0 || dsList.Tables[0].Rows.Count == 0)
            {
                PageCommon.AlertMsg(this, "There is no data in database.");
                return;
            }

            fileId         = int.Parse(dsList.Tables[0].Rows[0]["FileId"].ToString());
            hfdHisId.Value = fileId.ToString();
            var modelPointFiles = bllPointFiles.GetModel(fileId);

            if (modelPointFiles != null)
            {
                var modelPointFolder = bllPointFolders.GetModel(modelPointFiles.FolderId);
                if (modelPointFolder != null)
                {
                    lblPointFile.Text = modelPointFolder.Name + modelPointFiles.Name;
                }
            }

            lblBorrower.Text    = bllContact.GetBorrower(fileId);
            lblLoanOfficer.Text = bllUser.GetLoanOfficer(fileId);



            // Start: get icon name by fileId, 2010-11-15
            if (string.IsNullOrEmpty(imgSrc))
            {
                string strSeverity = dsList.Tables[0].Rows[0]["Severity"].ToString().ToLower();
                switch (strSeverity)
                {
                case "error":
                    imgIcon.Src = "../images/loan/AlertError.png";
                    break;

                case "warning":
                    imgIcon.Src = "../images/loan/AlertWarning.png";
                    break;

                default:
                    imgIcon.Visible = false;
                    break;
                }
            }
            else
            {
                imgIcon.Src = "../images/loan/" + imgSrc;
            }
            // End: get icon name by fileId, 2010-11-15

            DateTime dt = DateTime.MinValue;

            DateTime.TryParse(dsList.Tables[0].Rows[0]["ImportTime"].ToString(), out dt);

            if (dt != DateTime.MinValue)
            {
                lblTime.Text = dt.ToString("MM/dd/yyyy hh:mm:ss");
            }

            if (!string.IsNullOrEmpty(dsList.Tables[0].Rows[0]["Error"].ToString()))
            {
                string s1 = dsList.Tables[0].Rows[0]["Error"].ToString().Trim();
                s1 = s1.Replace("<br/>  ", "\r\n");
                s1 = s1.Replace("<br/> ", "\r\n");
                s1 = s1.Replace("<br/>", "\r\n");
                tbxErrorMessages.Text = s1;
            }
        }