private void getMain() { string id = Request.QueryString["id"].ToString(); EtNet_Models.Customer cus = CustomerManager.getCustomerById(Convert.ToInt32(id)); this.lblBank.Text = cus.Bank.ToString(); this.lblCardID.Text = cus.CardId.ToString(); this.lblName.Text = cus.CardName.ToString(); this.lblRemark.Text = cus.Remark.ToString(); }
//加载基本信息 private void loadcus() { string cusid = Request.QueryString["id"].ToString(); EtNet_Models.Customer cus = CustomerManager.getCustomerById(Convert.ToInt32(cusid)); this.cusshortname.Value = cus.CusshortName.ToString(); this.cusCName.Value = cus.CusCName.ToString(); this.cusCode.Value = cus.CusCode.ToString(); //this.hidordernum.Value = cus.Ordernum; //this.hidcodeformat.Value = cus.Codeformat; this.cusCAddress.Value = cus.CusCAddress.ToString(); this.companyURL.Value = cus.CompanyURL.ToString(); //this.rbPro.SelectedValue = cus.CusPro.ToString(); this.address.Text = cus.Province.ToString() + " " + cus.City.ToString(); this.lblMadeFrom.Value = LoginInfoManager.getLoginInfoById(cus.Madefrom).Cname; this.lblMadeTime.Value = cus.MadeTime.ToString("yyyy-MM-dd"); this.ddlToUser.SelectedValue = cus.CusType.ToString(); //this.rbUsed.SelectedValue = cus.Used.ToString(); //this.txtcustype.Text = CusTypeManager.getCusTypeById(cus.CusType).TypeName.ToString(); int id = cus.CusType; this.HidTypeID.Value = cus.CusType.ToString(); //主要联系人 //this.linkName.Value = cus.LinkName.ToString(); //this.linkPost.Value = cus.Post.ToString(); //this.linkTel.Value = cus.Telephone.ToString(); //this.linkMobile.Value = cus.Mobile.ToString(); //this.linkFax.Value = cus.Fax.ToString(); //this.linkEmail.Value = cus.Email.ToString(); //this.linkMsn.Value = cus.Msn.ToString(); //this.linkSkype.Value = cus.Skype.ToString(); //主要银行信息 this.bankName.Value = cus.Bank.ToString(); this.bankCard.Value = cus.CardId.ToString(); this.bankMan.Value = cus.CardName.ToString(); this.bankremark.Value = cus.Remark.ToString(); //提成系数 this.newRatio.Value = cus.newRatio.ToString(); this.oldRatio.Value = cus.oldRatio.ToString(); //显示修改人员和修改日期 DataTable dt = CustomerManager.GetList(" id = " + cusid); this.editman.Value = dt.Rows[0]["lasteditman"].ToString(); this.editdate.Value = Convert.IsDBNull(dt.Rows[0]["lasteditdate"]) ? "" : Convert.ToDateTime(dt.Rows[0]["lasteditdate"]).ToString("yyyy-MM-dd"); //SpecialSet(cusid); }
/// <summary> /// 添加客户信息 /// </summary> private void AddBase() { //基本信息 EtNet_Models.Customer cus = new EtNet_Models.Customer(); cus.CusCode = this.cusCode.Value.ToString(); cus.CusType = Convert.ToInt32(this.cusType.Value.ToString()); // cus.Province = this.ddlProvince.SelectedValue; //cus.City = this.ddlCity.SelectedValue; string[] addre = this.address.Text.ToString().Split(' ');// string[] sailing = args.Split('/'); cus.Province = addre[0].ToString(); cus.City = addre[1].ToString(); cus.CusCName = this.cusCname.Value.ToString(); cus.CompanyURL = this.comURL.Value.ToString(); cus.CusCAddress = this.cusCAdd.Value.ToString(); cus.CusPro = 1; cus.CusType = 1; //cus.Used = 0; //联系人 cus.LinkName = this.linkname.Value.ToString(); cus.Post = this.linkpost.Value.ToString(); cus.Telephone = this.linktel.Value.ToString(); cus.Mobile = this.linkmobile.Value.ToString(); cus.Fax = this.linkfax.Value.ToString(); cus.Email = this.linkemail.Value.ToString(); cus.Msn = this.linkmsn.Value.ToString(); cus.Skype = this.linkskype.Value.ToString(); //银行信息 cus.Bank = this.cusBank.Value.ToString(); cus.CardId = this.cusBankID.Value.ToString(); cus.CardName = this.cusBankName.Value.ToString(); cus.Remark = this.cusRemark.Value.ToString(); int count = CustomerManager.addCustomer(cus); if (count > 0) { this.none.Text = "1"; ScriptManager.RegisterStartupScript(this, GetType(), "key", "alert('添加成功')", true); // linkman(); cleardata(); } }
private void getmainlink() { string id = Request.QueryString["id"].ToString(); EtNet_Models.Customer cus = CustomerManager.getCustomerById(Convert.ToInt32(id)); this.lblLinkname.Text = cus.LinkName.ToString(); this.lblPost.Text = cus.Post.ToString(); this.lblTel.Text = cus.Telephone.ToString(); this.lblFax.Text = cus.Fax.ToString(); this.lblEmail.Text = cus.Email.ToString(); this.lblMobile.Text = cus.Mobile.ToString(); this.lblMsn.Text = cus.Msn.ToString(); this.lblSkype.Text = cus.Skype.ToString(); }
//加载基本信息 private void loadcus() { string cusid = Request.QueryString["id"].ToString(); EtNet_Models.Customer cus = CustomerManager.getCustomerById(Convert.ToInt32(cusid)); this.cusshortname.Value = cus.CusshortName.ToString(); this.cusCName.Value = cus.CusCName.ToString(); this.cusCAddress.Value = cus.CusCAddress.ToString(); this.companyURL.Value = cus.CompanyURL.ToString(); this.rbPro.SelectedValue = cus.CusPro.ToString(); this.address.Text = cus.Province.ToString() + " " + cus.City.ToString(); //this.txtcustype.Text = CusTypeManager.getCusTypeById(cus.CusType).TypeName.ToString(); this.lblMadeFrom.Value = LoginInfoManager.getLoginInfoById(((LoginInfo)Session["login"]).Id).Cname; this.lblMadeTime.Value = DateTime.Now.ToString("yyyy-MM-dd"); //this.rbUsed.SelectedValue = cus.Used.ToString(); int id = cus.CusType; if (id > 0) { this.TxtType.Text = CusTypeManager.getCusTypeById(cus.CusType).TypeName; } else { this.TxtType.Text = ""; } this.HidTypeID.Value = cus.CusType.ToString(); //主要联系人 this.linkName.Value = cus.LinkName.ToString(); this.linkPost.Value = cus.Post.ToString(); this.linkTel.Value = cus.Telephone.ToString(); this.linkMobile.Value = cus.Mobile.ToString(); this.linkFax.Value = cus.Fax.ToString(); this.linkEmail.Value = cus.Email.ToString(); this.linkMsn.Value = cus.Msn.ToString(); this.linkSkype.Value = cus.Skype.ToString(); //主要银行信息 this.bankName.Value = cus.Bank.ToString(); this.bankCard.Value = cus.CardId.ToString(); this.bankMan.Value = cus.CardName.ToString(); this.bankremark.Value = cus.Remark.ToString(); RuleSet(cusid); }
/// <summary> /// 回收客户审批资料 /// </summary> /// <param name="jfid">客户的id值</param> private void RefreshCus(int id) { string login = ((EtNet_Models.LoginInfo)Session["login"]).Id.ToString(); string strsql = " id=" + id; string strfields = " madefrom,jobflowcode,auditstatus "; DataTable tbl = EtNet_BLL.ViewBLL.ViewCustomerManager.getList(strfields, strsql); if (tbl.Rows.Count == 0) { Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "share", "<script>alert('该客户已删除')</script>"); } else { string str = "<script>alert('成功收回客户!')</script>"; if (tbl.Rows[0]["jobflowcode"].ToString() == "") { Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "share", "<script>alert('客户资料缺失导致无法回收')</script>"); } else if (tbl.Rows[0]["auditstatus"].ToString() == "02" || tbl.Rows[0]["auditstatus"].ToString() == "04") { str = "<script>alert('回收失败,只有状态是未开始与被拒绝的客户才能回收')</script>"; } else if (tbl.Rows[0]["madefrom"].ToString() != login) { str = "<script>alert('回收失败,无此权限')</script>"; } else { int jfid = int.Parse(tbl.Rows[0]["jobflowcode"].ToString()); string strfresh = " jobflowid = " + jfid.ToString(); EtNet_BLL.AuditJobFlowManager.Delete(strfresh); //删除审核人员的数据 EtNet_Models.JobFlow model = EtNet_BLL.JobFlowManager.GetModel(jfid); model.savestatus = "草稿"; model.auditstatus = "01"; EtNet_BLL.JobFlowManager.Update(model); EtNet_Models.Customer cus = EtNet_BLL.CustomerManager.getCustomerById(id); cus.Txt = ""; EtNet_BLL.CustomerManager.updateCustomer(cus); } Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "refresh", str, false); } }
protected void rpCustomer_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "Delete") { int id = Convert.ToInt32(e.CommandArgument); EtNet_Models.Customer model = EtNet_BLL.CustomerManager.getCustomerById(id); if (model != null) { CusBankManager.deleteCusBankByCusId(model.Id); CusLinkmanManager.deleteCusLinkmanByCusId(model.Id); int count = CustomerManager.deleteCustomer(model.Id); if (count <= 0) { ClientScript.RegisterClientScriptBlock(this.GetType(), "page", "alert('删除失败')", true); return; } } } dataBind(); }
private void loadCus() { string id = Request.QueryString["id"].ToString(); EtNet_Models.Customer customer = 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 = LoginInfoManager.getLoginInfoById(customer.CusType).Cname; } //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.lblnewRatio.Text = customer.newRatio.ToString(); this.lbloldRatio.Text = customer.oldRatio.ToString(); this.lblMadeFrom.Text = LoginInfoManager.getLoginInfoById(customer.Madefrom).Cname; this.lblMadeTime.Text = customer.MadeTime.ToString("yyyy-MM-dd"); //加载修改人员和修改日期 DataTable dt = CustomerManager.GetList(" id = " + id); this.lbleditman.Text = dt.Rows[0]["lasteditman"].ToString(); this.lbleditdate.Text = Convert.IsDBNull(dt.Rows[0]["lasteditdate"]) ? "" : Convert.ToDateTime(dt.Rows[0]["lasteditdate"]).ToString("yyyy-MM-dd"); loadOtherLink(); loadOtherBank(); //LoadAuditImg(customer.Jobflowid); //LoadNowAudit(customer.Jobflowid); }
/// <summary> /// 添加收款单位信息 /// </summary> private void AddBase(string sort) { string cuscode = ""; //公司代码全称 string codeformat = ""; //公司代码,不包含流水号 string ordernum = ""; //流水号 if (StrNumbers(this.cusCode.Value, out cuscode, out codeformat, out ordernum)) { //EtNet_Models.JobFlow model = new JobFlow(); //model.attachment = codeformat; //model.txt = ordernum; //model.cname = cuscode; //model.sort = "03"; //收款单位管理申请 //model.auditsort = ""; //model.auditstatus = "01"; //model.createtime = DateTime.Now; //默认是当前时间 //model.endtime = DateTime.Now; //model.founderid = ((EtNet_Models.LoginInfo)Session["login"]).Id; //登录人员的id // model.ruleid = int.Parse(this.ddlrule.SelectedValue); //if (sort == "save") //{ // model.savestatus = "草稿"; //} //else //{ // model.savestatus = "已提交"; //} //int maxid = EtNet_BLL.JobFlowManager.AddAndGetId(model); //工作流的id值 //if (sort != "save") //{ // CreateApproval(model.ruleid, maxid); // SendInformation(maxid, model.ruleid); //} //基本信息 EtNet_Models.Customer cus = new EtNet_Models.Customer(); cus.CusCode = cuscode; //收款单位代码 cus.Codeformat = codeformat; //编码规则 cus.Ordernum = ordernum; //流水号 //cus.Jobflowid = maxid; //工作流id cus.Txt = ""; //审核意见 cus.Viewidlist = ""; // cus.Viewidtxt = ""; cus.Authidlist = ""; cus.Authidtxt = ""; //修改为指定人员 cus.CusType = Convert.ToInt32(this.ddlToUser.SelectedValue); //cus.Province = this.ddlProvince.SelectedValue; //cus.City = this.ddlCity.SelectedValue; cus.CusshortName = this.cusshortname.Value.ToString(); string[] addre = this.address.Text.ToString().Split(' ');// string[] sailing = args.Split('/'); cus.Province = addre[0].ToString(); cus.City = addre[1].ToString(); cus.CusCName = this.cusCName.Value.ToString(); //修改为收款单位录入时间 cus.CompanyURL = this.companyURL.Value.ToString(); cus.CusCAddress = this.cusCAddress.Value.ToString(); //修改收款单位等级 TimeSpan ts = DateTime.Now - Convert.ToDateTime(this.companyURL.Value); int Days = ts.Days; //0为新收款单位。1为老收款单位。 if (Days > 365) { cus.CusPro = 1; } else { cus.CusPro = 0; } //cus.Used = Convert.ToInt32(this.rbUsed.SelectedItem.Value); //联系人 //cus.LinkName = this.linkName.Value.ToString(); //cus.Post = this.linkPost.Value.ToString(); //cus.Telephone = this.linkTel.Value.ToString(); //cus.Mobile = this.linkMobile.Value.ToString(); //cus.Fax = this.linkFax.Value.ToString(); //cus.Email = this.linkEmail.Value.ToString(); //cus.Msn = this.linkMsn.Value.ToString(); //cus.Skype = this.linkSkype.Value.ToString(); cus.LinkName = ""; cus.Post = ""; cus.Telephone = ""; cus.Mobile = ""; cus.Fax = ""; cus.Email = ""; cus.Msn = ""; cus.Skype = ""; //银行信息 cus.Bank = this.bankName.Value.ToString(); cus.CardId = this.bankCard.Value.ToString(); cus.CardName = this.bankMan.Value.ToString(); cus.Remark = this.bankremark.Value; cus.Madefrom = ((LoginInfo)Session["login"]).Id; cus.MadeTime = DateTime.Now; //提成系数 double ratio = 0; double.TryParse(this.newRatio.Value, out ratio); cus.newRatio = ratio; //新客户提成系数 ratio = 0; double.TryParse(this.oldRatio.Value, out ratio); cus.oldRatio = ratio; //老客户提成系数 int count = CustomerManager.addCustomer(cus); //得到收款单位id if (count > 0) { addlink(count); addbank(count); if (sort == "save") { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('保存成功!');location.href='../CusInfo/Customer.aspx'", true); } else { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('送审成功!');location.href='../CusInfo/Customer.aspx'", true); } } } }
//保存修改后的资料(未审核) private void AddBase(string sort) { string cusid = Request.QueryString["id"].ToString(); EtNet_Models.Customer cus = CustomerManager.getCustomerById(Convert.ToInt32(cusid)); //基本信息 // EtNet_Models.Customer cus = new EtNet_Models.Customer(); cus.Id = Convert.ToInt32(Request.QueryString["id"].ToString()); cus.CusCode = this.cusCode.Value.ToString(); //cus.Codeformat = this.hidcodeformat.Value; //cus.Ordernum = this.hidordernum.Value; cus.CusshortName = this.cusshortname.Value.ToString(); // cus.Province = this.ddlProvince.SelectedValue; //cus.City = this.ddlCity.SelectedValue; cus.CusType = Convert.ToInt32(this.ddlToUser.SelectedValue); string[] addre = this.address.Text.ToString().Split(' ');// string[] sailing = args.Split('/'); cus.Province = addre[0].ToString(); cus.City = addre[1].ToString(); cus.CusCName = this.cusCName.Value.ToString(); cus.CompanyURL = this.companyURL.Value.ToString(); cus.CusCAddress = this.cusCAddress.Value.ToString(); //修改客户等级 TimeSpan ts = DateTime.Now - Convert.ToDateTime(this.companyURL.Value); int Days = ts.Days; //0为新客户。1为老客户。 if (Days > 365) { cus.CusPro = 1; } else { cus.CusPro = 0; } //cus.Used = Convert.ToInt32(this.rbUsed.SelectedItem.Value); //联系人 //cus.LinkName = this.linkName.Value.ToString(); //cus.Post = this.linkPost.Value.ToString(); //cus.Telephone = this.linkTel.Value.ToString(); //cus.Mobile = this.linkMobile.Value.ToString(); //cus.Fax = this.linkFax.Value.ToString(); //cus.Email = this.linkEmail.Value.ToString(); //cus.Msn = this.linkMsn.Value.ToString(); //cus.Skype = this.linkSkype.Value.ToString(); cus.LinkName = ""; cus.Post = ""; cus.Telephone = ""; cus.Mobile = ""; cus.Fax = ""; cus.Email = ""; cus.Msn = ""; cus.Skype = ""; //银行信息 cus.Bank = this.bankName.Value.ToString(); cus.CardId = this.bankCard.Value.ToString(); cus.CardName = this.bankMan.Value.ToString(); cus.Remark = this.bankremark.Value.ToString(); //cus.Madefrom = ((LoginInfo)Session["Login"]).Id; //cus.MadeTime = DateTime.Now; //提成系数 double ratio = 0; double.TryParse(this.newRatio.Value, out ratio); cus.newRatio = ratio; //新客户提成系数 ratio = 0; double.TryParse(this.oldRatio.Value, out ratio); cus.oldRatio = ratio; //老客户提成系数 cus.LastEditMan = ((LoginInfo)Session["login"]).Cname; cus.LastEditDate = DateTime.Now; int count = CustomerManager.updateCustomer(cus); if (count > 0) { addbank(); addlink(); if (sort == "save") { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('保存成功!');location.href='../CusInfo/Customer.aspx'", true); } else { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('送审成功!');location.href='../CusInfo/Customer.aspx'", true); } } }
private void AddBase(string sort) { string cuscode = ""; //公司代码全称 string codeformat = ""; //公司代码,不包含流水号 string ordernum = ""; //流水号 if (StrNumbers(this.cusCode.Value, out cuscode, out codeformat, out ordernum)) { EtNet_Models.JobFlow model = new JobFlow(); model.attachment = codeformat; model.txt = ordernum; model.cname = cuscode; model.sort = "03"; //客户管理申请 model.auditsort = ""; model.auditstatus = "01"; model.createtime = DateTime.Now; //默认是当前时间 model.endtime = DateTime.Now; model.founderid = ((EtNet_Models.LoginInfo)Session["login"]).Id; //登录人员的id model.ruleid = int.Parse(this.ddlrule.SelectedValue); if (sort == "save") { model.savestatus = "草稿"; } else { model.savestatus = "已提交"; } int maxid = EtNet_BLL.JobFlowManager.AddAndGetId(model); //工作流的id值 if (sort != "save") { CreateApproval(model.ruleid, maxid); SendInformation(maxid, model.ruleid); } //基本信息 EtNet_Models.Customer cus = new EtNet_Models.Customer(); // cus.Id = Convert.ToInt32(Request.QueryString["id"].ToString()); cus.CusCode = cuscode; cus.Codeformat = codeformat; cus.Ordernum = ordernum; cus.CusshortName = this.cusshortname.Value.ToString(); cus.Jobflowid = maxid; cus.Txt = ""; cus.Viewidlist = ""; cus.Viewidtxt = ""; cus.Authidlist = ""; cus.Authidtxt = ""; //cus.Province = this.ddlProvince.SelectedValue; //cus.City = this.ddlCity.SelectedValue; cus.CusType = Convert.ToInt32(this.HidTypeID.Value); string[] addre = this.address.Text.ToString().Split(' ');// string[] sailing = args.Split('/'); cus.Province = addre[0].ToString(); cus.City = addre[1].ToString(); cus.CusCName = this.cusCName.Value.ToString(); cus.CompanyURL = this.companyURL.Value.ToString(); cus.CusCAddress = this.cusCAddress.Value.ToString(); cus.CusPro = Convert.ToInt32(this.rbPro.SelectedItem.Value); //cus.Used = Convert.ToInt32(this.rbUsed.SelectedItem.Value); //联系人 cus.LinkName = this.linkName.Value.ToString(); cus.Post = this.linkPost.Value.ToString(); cus.Telephone = this.linkTel.Value.ToString(); cus.Mobile = this.linkMobile.Value.ToString(); cus.Fax = this.linkFax.Value.ToString(); cus.Email = this.linkEmail.Value.ToString(); cus.Msn = this.linkMsn.Value.ToString(); cus.Skype = this.linkSkype.Value.ToString(); cus.Madefrom = ((LoginInfo)Session["Login"]).Id; cus.MadeTime = DateTime.Now; //银行信息 cus.Bank = this.bankName.Value.ToString(); cus.CardId = this.bankCard.Value.ToString(); cus.CardName = this.bankMan.Value.ToString(); cus.Remark = this.bankremark.Value.ToString(); cus.Madefrom = ((LoginInfo)Session["login"]).Id; cus.MadeTime = DateTime.Now; int count = CustomerManager.addCustomer(cus); if (count > 0) { addbank(); addlink(); if (sort == "save") { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('保存成功!');location.href='../CusInfo/Customer.aspx'", true); } else { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('送审成功!');location.href='../CusInfo/Customer.aspx'", true); } } } }