예제 #1
0
        /// <summary>
        /// 获取客户银行列表
        /// </summary>
        /// <param name="customerID"></param>
        /// <returns></returns>
        private string GetCustomerBankList(int customerID)
        {
            DataTable dtBankList = CusBankManager.getList(customerID);

            StringBuilder htmlBuilder = new StringBuilder();

            EtNet_Models.Customer customer = CustomerManager.getCustomerById(customerID);

            if (customer != null && customer.Bank.Trim() != string.Empty)
            {
                htmlBuilder.AppendFormat("<option value=\"{0}\">", customer.CardId + "$" + customer.CardName + "$" + customer.Remark);
                //htmlBuilder.Append("<option value=\"0\">");
                htmlBuilder.Append(customer.Bank);
                htmlBuilder.Append("</option>");
            }

            if (dtBankList.Rows.Count > 0)
            {
                int rowCount = dtBankList.Rows.Count;
                for (int i = 0; i < rowCount; i++)
                {
                    DataRow currentRow = dtBankList.Rows[i];
                    htmlBuilder.AppendFormat("<option value=\"{0}\">", currentRow["id"]);
                    htmlBuilder.Append(currentRow["bank"]);
                    htmlBuilder.Append("</option>");
                }
            }

            return(htmlBuilder.ToString());
        }
예제 #2
0
 /// <summary>
 /// 保存
 /// </summary>
 private void SaveCus()
 {
     if (this.ddlcus.SelectedIndex != 0)
     {
         int id = int.Parse(this.ddlcus.SelectedValue);
         EtNet_Models.Customer cus = EtNet_BLL.CustomerManager.getCustomerById(id);
         if (cus == null)
         {
             this.imgbtnsave.Enabled = false;
         }
         else
         {
             cus.Viewidlist = this.hidlist.Value;
             cus.Viewidtxt  = this.hidtxtlist.Value;
             cus.Authidlist = this.hidulist.Value;
             cus.Authidtxt  = this.hidtxtulist.Value;
             if (EtNet_BLL.CustomerManager.updateCustomer(cus) >= 1)
             {
                 LoadCusData();
                 Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "save", "<script>alert('保存成功!')</script>", false);
             }
         }
     }
     else
     {
         Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "save", "<script>alert('未选中任何客户!')</script>", false);
     }
 }
예제 #3
0
 /// <summary>
 /// 加载客户
 /// </summary>
 private void LoadCusData()
 {
     if (this.ddlcus.SelectedIndex != 0)
     {
         int id = int.Parse(this.ddlcus.SelectedValue);
         EtNet_Models.Customer cus = EtNet_BLL.CustomerManager.getCustomerById(id);
         if (cus == null)
         {
             this.imgbtnsave.Enabled = false;
         }
         else
         {
             LoadViewCus(cus.Viewidlist, cus.Viewidtxt);
             LoadAuthCus(cus.Authidlist, cus.Authidtxt);
         }
     }
     else
     {
         this.hidlist.Value     = "";
         this.hidtxtlist.Value  = "";
         this.hidulist.Value    = "";
         this.hidtxtulist.Value = "";
         this.listleft.Items.Clear();
         this.listright.Items.Clear();
         this.listuleft.Items.Clear();
         this.listuright.Items.Clear();
         Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "save", "<script>alert('未选中任何客户!')</script>", false);
     }
 }
예제 #4
0
        private void ModifyCus(int cid, string idlist)
        {
            int id = int.Parse(Request.QueryString["id"]);

            EtNet_Models.Customer cus = null;
            string viewlist           = "";
            string viewtxt            = "";
            string login     = "";
            string logincame = "";

            EtNet_Models.LoginInfo model = EtNet_BLL.LoginInfoManager.getLoginInfoById(id);

            string list  = "," + idlist + ",";
            string cusid = "," + cid + ",";

            if (list.IndexOf(cusid) != -1)
            {
                cus      = EtNet_BLL.CustomerManager.getCustomerById(cid);
                viewlist = "," + cus.Viewidlist + ",";
                login    = "******" + id.ToString() + ",";

                if (viewlist.IndexOf(login) == -1)
                {
                    if (cus.Viewidlist != "")
                    {
                        cus.Viewidlist += "," + model.Id.ToString();
                        cus.Viewidtxt  += "," + model.Cname;
                    }
                    else
                    {
                        cus.Viewidlist = model.Id.ToString();
                        cus.Viewidtxt  = model.Cname;
                    }
                    EtNet_BLL.CustomerManager.updateCustomer(cus);
                }
            }
            else
            {
                cus       = EtNet_BLL.CustomerManager.getCustomerById(cid);
                viewlist  = "," + cus.Viewidlist + ",";
                viewtxt   = "," + cus.Viewidtxt + ",";
                login     = "******" + id.ToString() + ",";
                logincame = "," + model.Cname + ",";
                if (viewlist.IndexOf(login) != -1)
                {
                    cus.Viewidlist = viewlist.Replace(login, "").Trim(',');
                    cus.Viewidtxt  = viewtxt.Replace(logincame, "").Trim(',');
                    EtNet_BLL.CustomerManager.updateCustomer(cus);
                }
            }
        }
예제 #5
0
        /// <summary>
        /// 加载客户
        /// </summary>
        private void LoadCusData()
        {
            int id = int.Parse(Request.QueryString["id"]);

            EtNet_Models.Customer cus = EtNet_BLL.CustomerManager.getCustomerById(id);
            if (cus == null)
            {
                this.imgbtnsave.Enabled = false;
            }
            else
            {
                LoadViewCus(cus.Viewidlist, cus.Viewidtxt);
                LoadAuthCus(cus.Authidlist, cus.Authidtxt);
            }
        }
예제 #6
0
        //保存
        protected void imgbtnsave_Click(object sender, ImageClickEventArgs e)
        {
            int id = int.Parse(Request.QueryString["id"]);

            EtNet_Models.Customer cus = EtNet_BLL.CustomerManager.getCustomerById(id);
            if (cus == null)
            {
                this.imgbtnsave.Enabled = false;
            }
            else
            {
                cus.Viewidlist = this.hidlist.Value;
                cus.Viewidtxt  = this.hidtxtlist.Value;
                cus.Authidlist = this.hidulist.Value;
                cus.Authidtxt  = this.hidtxtulist.Value;
                if (EtNet_BLL.CustomerManager.updateCustomer(cus) >= 1)
                {
                    LoadCusData();
                    Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "save", "<script>closecus()</script>", false);
                }
            }
        }
예제 #7
0
        /// <summary>
        /// 绑定客户银行列表
        /// </summary>
        private void FillCustomerBank(DataTable dtBankList, int customerID)
        {
            EtNet_Models.Customer customer = CustomerManager.getCustomerById(customerID);

            if (customer != null && customer.Bank.Trim() != string.Empty)
            {
                DataRow newRow = dtBankList.NewRow();

                newRow["bankId"]      = 0;
                newRow["bankName"]    = customer.Bank;// string.Format("{0}(主银行)", customer.Bank);
                newRow["bankAccount"] = customer.CardId;
                newRow["bankUser"]    = customer.CardName;
                newRow["bankMark"]    = customer.Remark;

                dtBankList.Rows.Add(newRow);
            }

            DataTable dtCustomerBankList = CusBankManager.getList(customerID);

            if (dtCustomerBankList.Rows.Count > 0)
            {
                int rowCount = dtCustomerBankList.Rows.Count;
                for (int i = 0; i < rowCount; i++)
                {
                    DataRow currentRow = dtCustomerBankList.Rows[i];
                    DataRow newRow     = dtBankList.NewRow();

                    newRow["bankId"]      = currentRow["id"];
                    newRow["bankName"]    = currentRow["bank"];
                    newRow["bankAccount"] = currentRow["cardId"];
                    newRow["bankUser"]    = currentRow["cardName"];
                    newRow["bankMark"]    = currentRow["remark"];

                    dtBankList.Rows.Add(newRow);
                }
            }
        }
예제 #8
0
        /// <summary>
        /// 拒绝方法
        /// </summary>
        private void Refuse()
        {
            int jobflowid = int.Parse(Request.QueryString["jobflowid"].ToString()); //工作流的id

            EtNet_Models.LoginInfo login = (EtNet_Models.LoginInfo)Session["login"];

            string comparedata = " reviewerid=" + login.Id + " AND jobflowid=" + jobflowid.ToString();

            if (EtNet_BLL.AuditJobFlowManager.GetList(comparedata).Rows.Count == 0)
            {
                //该工作流被收回或删除导致审批提交失败
                Response.Redirect("../Job/AuditError.aspx?error=0");
            }
            else if (EtNet_BLL.JobFlowManager.GetModel(jobflowid).auditstatus == "03" || EtNet_BLL.JobFlowManager.GetModel(jobflowid).auditstatus == "04")
            {
                //该工作流是审核方式是选审或会签所以在提交审核时,工作流已由他人审核通过
                Response.Redirect("../Job/AuditError.aspx?error=1");
            }

            else
            {
                string    ruletxt = ""; //审核的分类
                string    strsql  = " jobflowcode=" + jobflowid.ToString();
                DataTable tbl     = EtNet_BLL.ViewBLL.ViewCustomerManager.getList("", strsql);
                if (tbl.Rows.Count == 1)
                {
                    int ruleid = int.Parse(tbl.Rows[0]["ruleid"].ToString());
                    EtNet_Models.ApprovalRule rule = EtNet_BLL.ApprovalRuleManager.GetModel(ruleid);
                    ruletxt = rule.sort;

                    //修改当前审核人的记录
                    EtNet_Models.AuditJobFlow auditmodel = null;
                    string    auditstr     = " jobflowid=" + jobflowid.ToString() + " AND reviewerid=" + login.Id;
                    DataTable audittbl     = EtNet_BLL.AuditJobFlowManager.GetList(auditstr);   // 查找到当前审核人员的记录
                    int       num          = int.Parse(audittbl.Rows[0]["numbers"].ToString()); //当前审核人员编号
                    string    mainreviewer = audittbl.Rows[0]["mainreviewer"].ToString();       //当前审核人是不是最终审核人

                    auditmodel              = new EtNet_Models.AuditJobFlow();
                    auditmodel.auditoperat  = "拒绝";
                    auditmodel.audittime    = DateTime.Now;
                    auditmodel.id           = int.Parse(audittbl.Rows[0]["id"].ToString());
                    auditmodel.jobflowid    = int.Parse(audittbl.Rows[0]["jobflowid"].ToString());
                    auditmodel.mainreviewer = audittbl.Rows[0]["mainreviewer"].ToString();
                    auditmodel.nowreviewer  = "P"; //能查找到工作流记录,但不能进行审核操作
                    auditmodel.numbers      = int.Parse(audittbl.Rows[0]["numbers"].ToString());
                    auditmodel.operatstatus = "已审批";
                    auditmodel.reviewerid   = int.Parse(audittbl.Rows[0]["reviewerid"].ToString());
                    auditmodel.opiniontxt   = Server.UrlDecode(this.iptcomment.Value.Trim());
                    EtNet_BLL.AuditJobFlowManager.Update(auditmodel);

                    EtNet_Models.JobFlow jobflowmodel = new EtNet_Models.JobFlow();
                    jobflowmodel = EtNet_BLL.JobFlowManager.GetModel(jobflowid);

                    //依据不同的审核类型进行操作
                    switch (ruletxt)
                    {
                    case "单审":
                    case "会审":
                        jobflowmodel.endtime     = DateTime.Now;
                        jobflowmodel.auditstatus = "03";     //工作流的审核状态为“被拒绝”
                        EtNet_BLL.JobFlowManager.Update(jobflowmodel);

                        break;

                    case "选审":
                        string    st     = " jobflowid=" + jobflowid.ToString();
                        DataTable tbla   = EtNet_BLL.AuditJobFlowManager.GetList(st);
                        bool      refuse = true;

                        for (int j = 0; j < tbla.Rows.Count; j++)
                        {
                            if (tbla.Rows[j]["auditoperat"].ToString() != "拒绝")
                            {
                                refuse = false;     //还有其他审核人员未审
                                break;
                            }
                        }
                        if (refuse)
                        {
                            jobflowmodel.endtime     = DateTime.Now;
                            jobflowmodel.auditstatus = "03";     // 工作流的审核状态为被拒绝
                            EtNet_BLL.JobFlowManager.Update(jobflowmodel);
                        }
                        else
                        {
                            jobflowmodel.auditstatus = "02";     // 工作流的审核状态为进行中
                            EtNet_BLL.JobFlowManager.Update(jobflowmodel);
                        }
                        break;
                    }


                    string strad = "编号为" + jobflowmodel.cname + "的客户,【" + login.Cname + "】拒绝审批!";
                    SendInfo(strad, jobflowmodel.id);

                    //修改客户的审核意见
                    int cusid = int.Parse(tbl.Rows[0]["id"].ToString());
                    EtNet_Models.Customer cus = EtNet_BLL.CustomerManager.getCustomerById(cusid);
                    cus.Txt = cus.Txt + login.Cname + "的审批意见:" + Server.UrlDecode(this.iptcomment.Value.Trim()) + "|";
                    EtNet_BLL.CustomerManager.updateCustomer(cus);

                    if (HttpContext.Current.Request.QueryString["pageindex"] != null)
                    {
                        int page = int.Parse(HttpContext.Current.Request.QueryString["pageindex"]);
                        Response.Redirect("../Job/AuditJobFlow.aspx?page=" + page + "");
                    }
                    else
                    {
                        Response.Redirect("../Job/AuditJobFlow.aspx");
                    }
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "audit", "<script> alert('审批出错!')</script>", false);
                }
            }
        }
예제 #9
0
        private void loadCus()
        {
            string    jfid   = Request.QueryString["jobflowid"].ToString();
            string    strsql = " jobflowid=" + jfid;
            DataTable tbl    = EtNet_BLL.CustomerManager.GetList(strsql);

            if (tbl.Rows.Count == 0)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "audit", "alert('数据出错,客户可能已删除!');location.href='../Job/AuditJobFlow.aspx'", true);
                return;
            }
            int id = int.Parse(tbl.Rows[0]["id"].ToString());

            EtNet_Models.Customer customer = EtNet_BLL.CustomerManager.getCustomerById(Convert.ToInt32(id));
            //基本信息
            this.lblcuscode.Text    = customer.CusCode.ToString() + " ";
            this.lblshortname.Text  = customer.CusshortName.ToString() + " ";
            this.lbladdress.Text    = customer.Province.ToString() + " " + customer.City.ToString() + " ";
            this.lblcname.Text      = customer.CusCName.ToString() + " ";
            this.lblcompanyurl.Text = customer.CompanyURL.ToString() + " ";

            if (customer.CusType == 0)
            {
                this.lblcustype.Text = "暂未选择类别";
            }
            else
            {
                this.lblcustype.Text = EtNet_BLL.CusTypeManager.getCusTypeById(customer.CusType).TypeName.ToString();
            }

            if (customer.Used == 0)
            {
                this.lblused.Text = "暂未启用";
            }
            else
            {
                this.lblused.Text = "已启用";
            }


            if (customer.CusPro == 0)
            {
                this.lblcuspro.Text = "潜在客户";
            }
            else
            {
                this.lblcuspro.Text = "正式客户";
            }


            this.lblcaddress.Text = customer.CusCAddress.ToString() + " ";

            //主要联系人
            this.lbllinkname.Text   = customer.LinkName.ToString() + " ";
            this.lbllinkpost.Text   = customer.Post.ToString() + " ";
            this.lbllinkfax.Text    = customer.Fax.ToString() + " ";
            this.lbllinkemail.Text  = customer.Email.ToString() + " ";
            this.lbllinkmobile.Text = customer.Mobile.ToString() + " ";
            this.lbllinktel.Text    = customer.Telephone.ToString() + " ";
            this.lbllinkskype.Text  = customer.Skype.ToString() + " ";
            this.lbllinkmsn.Text    = customer.Msn.ToString() + " ";

            //主要银行信息
            this.lblbank.Text     = customer.Bank.ToString() + " ";
            this.lblbankcard.Text = customer.CardId.ToString() + " ";
            this.lblbankman.Text  = customer.CardName.ToString() + " ";
            this.lblremark.Text   = customer.Remark.ToString() + " ";


            this.lblMadeFrom.Text = EtNet_BLL.LoginInfoManager.getLoginInfoById(customer.Madefrom).Cname;
            this.lblMadeTime.Text = customer.MadeTime.ToString("yyyy-MM-dd");

            loadOtherLink(id);
            loadOtherBank(id);
        }
예제 #10
0
        protected void rptauditjobflow_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            switch (e.CommandName)
            {
            case "audit":
                string[] str = e.CommandArgument.ToString().Split('-');
                string   rs  = ReviewerStatus(str[0], ((EtNet_Models.LoginInfo)Session["login"]).Id);
                if (rs == "")
                {
                    //工作流已删除或审核人员已更改
                    LoadRptjobflowData();
                    Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "faudit", "<script>alert('不能进入审批界面,原因可能是该申请已修改或删除!')</script>", false);
                    return;
                }
                else if (rs == "F")
                {
                    LoadRptjobflowData();
                    Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "faudit", "<script>alert('不能进入审批界面,原因可能是审批受限制!')</script>", false);
                }
                else if (rs == "T")
                {
                    string strstatus = JobFlowAuditStatus(int.Parse(str[0]));
                    if (strstatus == "03" || strstatus == "04")
                    {
                        Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "auditR", "<script>alert('该工作流已由他人审批,无需再审!')</script>", false);
                    }
                    else
                    {
                        if (str[1] == "01")
                        {
                            if (HttpContext.Current.Request.QueryString["page"] != null)
                            {
                                int page = int.Parse(HttpContext.Current.Request.QueryString["page"]);
                                Response.Redirect("ReimbursedForm/AuditReimbursedForm.aspx?pageindex=" + page + "&jobflowid=" + str[0]);
                            }
                            else
                            {
                                Response.Redirect("ReimbursedForm/AuditReimbursedForm.aspx?jobflowid=" + str[0]);
                            }
                        }

                        else if (str[1] == "02")
                        {
                            if (HttpContext.Current.Request.QueryString["page"] != null)
                            {
                                int page = int.Parse(HttpContext.Current.Request.QueryString["page"]);
                                Response.Redirect("../Order/AuditOrder.aspx?pageindex=" + page + "&jobflowid=" + str[0]);
                            }
                            else
                            {
                                Response.Redirect("../Order/AuditOrder.aspx?jobflowid=" + str[0]);
                            }
                        }
                        else if (str[1] == "03")
                        {
                            if (HttpContext.Current.Request.QueryString["page"] != null)
                            {
                                int page = int.Parse(HttpContext.Current.Request.QueryString["page"]);
                                Response.Redirect("../CusInfo/AuditCus.aspx?pageindex=" + page + "&jobflowid=" + str[0]);
                            }
                            else
                            {
                                Response.Redirect("../CusInfo/AuditCus.aspx?jobflowid=" + str[0]);
                            }
                        }
                        else if (str[1] == "04")
                        {
                            if (HttpContext.Current.Request.QueryString["page"] != null)
                            {
                                int page = int.Parse(HttpContext.Current.Request.QueryString["page"]);
                                Response.Redirect("../Announcement/AnnouncementAuditFirm.aspx?pageindex=" + page + "&jobflowid=" + str[0]);
                            }
                            else
                            {
                                Response.Redirect("../Announcement/AnnouncementAuditFirm.aspx?jobflowid=" + str[0]);
                            }
                        }
                        else if (str[1] == "05")
                        {
                            if (HttpContext.Current.Request.QueryString["page"] != null)
                            {
                                int page = int.Parse(HttpContext.Current.Request.QueryString["page"]);
                                Response.Redirect("../Financial/AuditPayment.aspx?pageindex=" + page + "&jobflowid=" + str[0]);
                            }
                            else
                            {
                                Response.Redirect("../Financial/AuditPayment.aspx?jobflowid=" + str[0]);
                            }
                        }
                        else
                        {
                        }
                    }
                }
                else if (rs == "P")
                {
                    Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "auditP", "<script>alert('不能重复审批!')</script>", false);
                }
                else
                {
                }
                break;

            case "search":
                string[] str2  = e.CommandArgument.ToString().Split('-');
                int      jfid2 = int.Parse(str2[0]);
                if (str2[1] == "01")     //报销审核的查看
                {
                    SearchReimbursement(jfid2);
                }
                else if (str2[1] == "02")     //定审核的查看
                {
                    SearchOrder(jfid2);
                }
                else if (str2[1] == "03")     //客户审批查看
                {
                    SearchCus(jfid2);
                }
                else if (str2[1] == "04")     //公告审核查看
                {
                    SearchAnnoun(jfid2);
                }
                else if (str2[1] == "05")     //付款申请单查看
                {
                    SearchPayment(jfid2);
                }
                break;

            case "refresh":
                string[]             str3     = e.CommandArgument.ToString().Split('-');
                int                  jfid3    = int.Parse(str3[0]);                                        //工作流id
                EtNet_Models.JobFlow model    = EtNet_BLL.JobFlowManager.GetModel(jfid3);                  //得到工作流实例
                string               strfresh = " jobflowid = " + jfid3;
                EtNet_BLL.AuditJobFlowManager.Delete(strfresh);                                            //删除审核数据,将审核状态改为初始状态
                model.savestatus  = "草稿";
                model.auditstatus = "01";                                                                  //审核状态改为未开始状态
                model.txt         = "";                                                                    //审核意见置空
                if (model.sort == "01")                                                                    //报销审核
                {
                    string id = EtNet_BLL.AusRottenInfoManager.GetList(strfresh).Rows[0]["id"].ToString(); //根据工作流id得到报销单的id值
                    EtNet_Models.AusRottenInfo rotten = EtNet_BLL.AusRottenInfoManager.GetModel(int.Parse(id));
                    if (rotten != null)
                    {
                        rotten.txt = "";    //清空审批人员的审批意见
                        EtNet_BLL.AusRottenInfoManager.Update(rotten);
                    }
                }
                else if (model.sort == "02")     //订单审核
                {
                }
                else if (model.sort == "03")     //客户审核
                {
                    string                sqlcus = " jobflowid = " + jfid3;
                    DataTable             tblcus = EtNet_BLL.CustomerManager.GetList(1, sqlcus, "id");
                    EtNet_Models.Customer cus    = EtNet_BLL.CustomerManager.getCustomerById(int.Parse(tblcus.Rows[0]["id"].ToString()));
                    if (cus != null)
                    {
                        cus.Txt = "";
                        EtNet_BLL.CustomerManager.updateCustomer(cus);
                    }
                }
                else if (model.sort == "04")     //公告审批
                {
                    string    sqlano = " jobflowid = " + jfid3;
                    DataTable tblano = EtNet_BLL.AnnouncementInfoManager.GetList(1, sqlano, "id");
                    EtNet_Models.AnnouncementInfo ano = EtNet_BLL.AnnouncementInfoManager.GetModel(int.Parse(tblano.Rows[0]["id"].ToString()));
                    if (ano != null)
                    {
                        ano.txt = "";
                        EtNet_BLL.AnnouncementInfoManager.Update(ano);
                    }
                }
                else if (model.sort == "05")     //付款审核
                {
                }

                if (EtNet_BLL.JobFlowManager.Update(model))
                {
                    Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "success", "<script>alert('撤销成功')</script>", false);
                }
                break;
            }
        }