protected void Button3_Click(object sender, EventArgs e) { int id = DataConverter.CLng(Request.QueryString["id"]); M_UserInfo userinfo = Uinfo.GetUserByUserID(id); M_Uinfo users = Uinfo.GetUserBaseByuserid(id); B_Client_Basic bsc = new B_Client_Basic(); M_Client_Basic client = new M_Client_Basic(); //通过客户姓名获取客户信息 DataTable dt = new DataTable(); dt = bsc.SelByName(userinfo.UserName.Trim()); if (dt == null || dt.Rows.Count <= 0) //如果找不到客户则升级 { client.Flow = 0; client.Client_Source = "在线注册"; client.Client_Area = users.Province; client.P_name = userinfo.UserName; client.Add_Date = DateTime.Now; client.Code = DataSecurity.MakeFileRndName(); client.Add_Name = userinfo.TrueName; client.Title = "在线注册"; M_Client_Penson person = new M_Client_Penson(); B_Client_Penson bperson = new B_Client_Penson(); person.Flow = 0; person.Code = client.Code; person.Birthday = DataConverter.CDate(users.BirthDay); person.city = users.County; person.country = users.Country; person.Fax_phone = users.Fax; person.Home_Phone = users.HomePhone; person.Homepage = users.HomePage; person.ICQ_Code = users.ICQ; person.Id_Code = users.IDCard; person.MSN_Code = users.MSN; person.Native = users.Province; person.province = users.County; person.QQ_Code = users.QQ; person.Telephone = users.Mobile; person.UC_Code = users.UC; person.Work_Phone = users.OfficePhone; person.YaoHu_Code = users.Yahoo; person.ZipCodeW = users.ZipCode; bsc.GetInsert(client); bperson.GetInsert(person); function.WriteSuccessMsg("升级成功,请进入客户管理系统管理客户信息!"); } else //否则就提示 { Response.Redirect("EditCus.aspx?id=" + id); } if (dt != null) { dt.Dispose(); } }
public bool InsertUpdate(M_Client_Basic model) { if (model.Flow > 0) { GetUpdate(model); } else { GetInsert(model); } return(true); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Call.HideBread(Master); if (Request.QueryString["menu"] != null && Request.QueryString["menu"] == "select") { int id = DataConverter.CLng(Request.QueryString["id"]); M_Client_Basic Binfo = bll.GetSelect(id); string types = Binfo.Client_Type; string Code = Binfo.Code; string scripttxt = "setvalue('TxtUserName','" + Binfo.P_name + "');"; if (types == "0") { DataTable ptable = pll.SelByCode(Binfo.Code); if (ptable != null && ptable.Rows.Count > 0) { M_Client_Penson pinfo = pll.GetSelect(DataConverter.CLng(ptable.Rows[0]["Flow"])); scripttxt += "setvalue('TxtUserTel','" + pinfo.Fax_phone + "');"; scripttxt += "setvalue('TxtUserMobile','" + pinfo.Work_Phone + "');"; scripttxt += "setvalue('TxtUserQQ','" + pinfo.QQ_Code + "');"; scripttxt += "setvalue('TxtUserMSN','" + pinfo.MSN_Code + "');"; scripttxt += "setvalue('TxtUserAddress','" + pinfo.Message_Address + "');"; scripttxt += "setvalue('TxtUserEmail','" + pinfo.Email_Address + "');"; } function.Script(this, scripttxt + ";onstr();"); Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "script", "<script>" + scripttxt + ";onstr();</script>"); } else { DataTable pstable = ell.SelByCode(Binfo.Code); if (pstable != null && pstable.Rows.Count > 0) { M_Client_Enterprise einfo = ell.GetSelect(DataConverter.CLng(pstable.Rows[0]["Flow"])); scripttxt += "setvalue('TxtUserTel','" + einfo.Phone + "');"; scripttxt += "setvalue('TxtUserMobile','" + einfo.Phone + "');"; scripttxt += "setvalue('TxtUserAddress','" + einfo.Message_Address + "');"; } function.Script(this, scripttxt + ";onstr();"); } } DataTable tables = bll.Select_All(); tables.DefaultView.Sort = "Flow desc"; Page_list(tables); } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["menu"] != null && Request.QueryString["menu"] == "select") { int id = DataConverter.CLng(Request.QueryString["id"]); M_Client_Basic Binfo = bll.GetSelect(id); string types = Binfo.Client_Type; string Code = Binfo.Code; string scripttxt = "setvalue('TxtUserName','" + Binfo.P_name + "');"; function.Script(Page, scripttxt + ";onstr();"); } if (!IsPostBack) { DataBind(); } DataTable tables = bll.Select_All(); tables.DefaultView.Sort = "Flow desc"; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string node_id = Request.QueryString["FieldName"].ToString(); if (node_id == "Client_All") { Response.Write("<script>javascript:document.title='客户组别'</script>"); this.Label1.Text = "客户组别"; } else if (node_id == "Phase_Trace") { Response.Write("<script>javascript:document.title='客户阶段'</script>"); this.Label1.Text = "客户阶段"; } DataSet table = new DataSet(); table.ReadXml(Server.MapPath("/Config/CRM_Dictionary.xml")); DataTable AreaTable = table.Tables["Client_Area"]; DataTable StatusTable = table.Tables["Co_Status"]; DataTable CallingTable = table.Tables["Client_Calling"]; DataTable ValueTable = table.Tables["Client_Value"]; DataTable CreditTable = table.Tables["Client_Credit"]; DataTable ImportanceTable = table.Tables["Client_Importance"]; DataTable ConnectionTable = table.Tables["Client_Connection"]; DataTable SourceTable = table.Tables["Client_Source"]; DataTable PhaseTable = table.Tables["Client_Phase"]; DataTable GroupTable = table.Tables["Client_Group"]; DataTable SizeTable = table.Tables["Co_Size"];//Co_Size DataTable ManagementTable = table.Tables["Co_Management"]; DataTable EducationTable = table.Tables["Linkman_Education"]; DataTable IncomeTable = table.Tables["Linkman_Income"]; #region 定义选项默认值的变量及初始值 string Areatxt = ""; string Statustxt = ""; string Callingtxt = ""; string Valuetxt = ""; string Credittxt = ""; string Importancetxt = ""; string Connectiontxt = ""; string Sourcetxt = ""; string Phasetxt = ""; string Grouptxt = ""; string Sizetxt = ""; string Managementtxt = ""; string Educationtxt = ""; string Incometxt = ""; #endregion #region 赋予选项的默认值 if (AreaTable != null && AreaTable.Rows.Count > 0) { for (int o = 0; o < AreaTable.Rows.Count; o++) { if (AreaTable.Rows[o]["default_"].ToString() == "True") { Areatxt = AreaTable.Rows[o]["sort"].ToString(); } } } if (StatusTable != null && StatusTable.Rows.Count > 0) { for (int o = 0; o < StatusTable.Rows.Count; o++) { if (StatusTable.Rows[o]["default_"].ToString() == "True") { Statustxt = StatusTable.Rows[o]["sort"].ToString(); } } } if (CallingTable != null && CallingTable.Rows.Count > 0) { for (int o = 0; o < CallingTable.Rows.Count; o++) { if (CallingTable.Rows[o]["default_"].ToString() == "True") { Callingtxt = CallingTable.Rows[o]["sort"].ToString(); } } } if (ValueTable != null && ValueTable.Rows.Count > 0) { for (int o = 0; o < ValueTable.Rows.Count; o++) { if (ValueTable.Rows[o]["default_"].ToString() == "True") { Valuetxt = ValueTable.Rows[o]["sort"].ToString(); } } } if (CreditTable != null && CreditTable.Rows.Count > 0) { for (int o = 0; o < CreditTable.Rows.Count; o++) { if (CreditTable.Rows[o]["default_"].ToString() == "True") { Credittxt = CreditTable.Rows[o]["sort"].ToString(); } } } if (ImportanceTable != null && ImportanceTable.Rows.Count > 0) { for (int o = 0; o < ImportanceTable.Rows.Count; o++) { if (ImportanceTable.Rows[o]["default_"].ToString() == "True") { Importancetxt = ImportanceTable.Rows[o]["sort"].ToString(); } } } if (ConnectionTable != null && ConnectionTable.Rows.Count > 0) { for (int o = 0; o < ConnectionTable.Rows.Count; o++) { if (ConnectionTable.Rows[o]["default_"].ToString() == "True") { Connectiontxt = ConnectionTable.Rows[o]["sort"].ToString(); } } } if (SourceTable != null && SourceTable.Rows.Count > 0) { for (int o = 0; o < SourceTable.Rows.Count; o++) { if (SourceTable.Rows[o]["default_"].ToString() == "True") { Sourcetxt = SourceTable.Rows[o]["sort"].ToString(); } } } if (PhaseTable != null && PhaseTable.Rows.Count > 0) { for (int o = 0; o < PhaseTable.Rows.Count; o++) { if (PhaseTable.Rows[o]["default_"].ToString() == "True") { Phasetxt = PhaseTable.Rows[o]["sort"].ToString(); } } } if (GroupTable != null && GroupTable.Rows.Count > 0) { for (int o = 0; o < GroupTable.Rows.Count; o++) { if (GroupTable.Rows[o]["default_"].ToString() == "True") { Grouptxt = GroupTable.Rows[o]["sort"].ToString(); } } } if (SizeTable != null && SizeTable.Rows.Count > 0) { for (int o = 0; o < SizeTable.Rows.Count; o++) { if (SizeTable.Rows[o]["default_"].ToString() == "True") { Sizetxt = SizeTable.Rows[o]["sort"].ToString(); } } } if (ManagementTable != null && ManagementTable.Rows.Count > 0) { for (int o = 0; o < ManagementTable.Rows.Count; o++) { if (ManagementTable.Rows[o]["default_"].ToString() == "True") { Managementtxt = ManagementTable.Rows[o]["sort"].ToString(); } } } if (EducationTable != null && EducationTable.Rows.Count > 0) { for (int o = 0; o < EducationTable.Rows.Count; o++) { if (EducationTable.Rows[o]["default_"].ToString() == "True") { Educationtxt = EducationTable.Rows[o]["sort"].ToString(); } } } if (IncomeTable != null && IncomeTable.Rows.Count > 0) { for (int o = 0; o < IncomeTable.Rows.Count; o++) { if (IncomeTable.Rows[o]["default_"].ToString() == "True") { Incometxt = IncomeTable.Rows[o]["sort"].ToString(); } } } #endregion //DropArea.Text = "";// DataConverter.CLng(Areatxt); //DropStatusInField.Text = "";// DataConverter.CLng(Statustxt); //DropClientField.Text = "";//DataConverter.CLng(Callingtxt); //DropValueLevel.Text = "";//DataConverter.CLng(Valuetxt); //DropCreditLevel.Text = "";//DataConverter.CLng(Credittxt); //DropImportance.Text = "";//DataConverter.CLng(Importancetxt); //DropConnectionLevel.Text = "";//DataConverter.CLng(Connectiontxt); //DropSourceType.Text = "";//DataConverter.CLng(Sourcetxt); //DropPhaseType.Text = "";//DataConverter.CLng(Phasetxt); //DropGroupID.Text = "";//DataConverter.CLng(Grouptxt); DropCompanySize.Text = ""; //DataConverter.CLng(Sizetxt); DropManagementForms.Text = ""; //DataConverter.CLng(Managementtxt); DropEducation.Text = ""; //DataConverter.CLng(Educationtxt); DropIncome.Text = ""; // DataConverter.CLng(Incometxt); int id = DataConverter.CLng(Request.QueryString["id"]); this.pid = id; M_Client_Basic binfo = basicBll.GetSelect(id); //htmlStr.Text = CreateHtml(selectedDT, true); //----- this.TxtClientName.Text = binfo.P_name; this.Pro_name = binfo.P_name; User_Title.InnerHtml = binfo.P_name; this.TxtClientNum.Text = binfo.Code; this.TxtShortedForm.Text = binfo.P_alias; this.ClientSelect.Text = binfo.Client_Upper; //this.DropArea.Text = binfo.Client_Area; DataTable Calling = GetTableList("Client_Calling"); try { // this.DropClientField.Text = Calling.Rows[DataConverter.CLng(binfo.Client_Calling)]["content"].ToString(); } catch { } //this.DropValueLevel.Text = binfo.Client_Value; //this.DropCreditLevel.Text = binfo.Client_Credit; //this.DropImportance.Text = binfo.Client_Importance; //this.DropConnectionLevel.Text = binfo.Client_Connection; //this.DropSourceType.Text = binfo.Client_Source; //this.DropPhaseType.Text = binfo.Client_Phase; //this.DropGroupID.Text = binfo.Client_Group; this.TxtRemark.Text = binfo.Title; //this.TxtCompany.Text = binfo.Unit_Name; //this.TxtDepartment.Text = binfo.Unit_Class; //this.TxtPosition.Text = binfo.Unit_Post; //this.TxtOperation.Text = binfo.Unit_Operation; //this.TxtCompanyAddress.Text = binfo.Unit_Address; //this.TxtTitle.Text = binfo.Unit_Title; ModelHtml.Text = ""; //--模型字段处理 var modelMod = modelBll.GetModelById(ModelID); if (modelMod != null && !string.IsNullOrEmpty(modelMod.TableName)) { DataTable contentDt = basicBll.GetContent(modelMod.TableName, binfo.ItemID); ModelHtml.Text = fieldBll.InputallHtml(ModelID, 0, new ModelConfig() { Source = ModelConfig.SType.Admin, ValueDT = contentDt, Mode = ModelConfig.SMode.PreView }); } //binfo.Add_Name = ull.GetLogin().UserName; binfo.Add_Date = DateTime.Today; binfo.Title = this.TxtRemark.Text; string scriptname = ""; if (binfo.Client_Type == "1") { this.Label1.Text = "查看企业客户"; this.ClientType.Text = "企业客户"; function.Script(this, "window.onload=function(){isPerson('Enterprise_Add');}"); DataTable tablesd = bce.SelByCode(binfo.Code); if (tablesd != null && tablesd.Rows.Count > 0) { int flowid = DataConverter.CLng(tablesd.Rows[0]["Flow"].ToString()); M_Client_Enterprise enterprise = bce.GetEnterpriseByCode(binfo.Code); this.TxtBankAccount.Text = enterprise.Bank_Code; this.TxtBankOfDeposit.Text = enterprise.Bank_Open; this.DropManagementForms.Text = enterprise.Co_Management; this.DropCompanySize.Text = enterprise.Co_Size; this.DropStatusInField.Text = enterprise.Co_Status; this.TxtClientNum.Text = enterprise.Code; this.TxtTaxNum.Text = enterprise.Tax_Code; this.TxtAnnualSales.Text = enterprise.Sales.ToString(); this.TxtRegisteredCapital.Text = enterprise.Reg_Capital.ToString(); this.TxtBusinessScope.Text = enterprise.Operation_Bound; this.TxtHomepage1.Text = enterprise.Homepage; this.TxtFax1.Text = enterprise.Fax_phone; this.TxtPhone.Text = enterprise.Phone; this.TxtAddress.Text = enterprise.Message_Address; this.TxtZipCodeW.Text = enterprise.ZipCodeW;// //enterprise.ZipCodeW = Request.Form["TxtZipCodeW"]; this.country.Text = enterprise.country; this.province.Text = enterprise.province; this.city.Text = enterprise.city; scriptname = "document.getElementById(\"country\").value = \"" + enterprise.country + "\";"; scriptname += "document.getElementById(\"province\").value = \"" + enterprise.province + "\";province_onchange(province,city);"; scriptname += "document.getElementById(\"city\").value = \"" + enterprise.city + "\";"; } } else { this.Label1.Text = "查看个人客户"; this.ClientType.Text = "个人客户"; function.Script(this, "window.onload=function(){isPerson('Person_Add');}"); DataTable tables = bcp.SelByCode(binfo.Code.Trim()); if (tables != null && tables.Rows.Count > 0) { int flowid = DataConverter.CLng(tables.Rows[0]["Flow"].ToString()); M_Client_Penson penson = bcp.GetSelect(flowid); this.TxtClientNum.Text = penson.Code; if (penson.Sex == "1") { this.RadlSex.Text = "男"; } else if (penson.Sex == "1") { this.RadlSex.Text = "女"; } else { this.RadlSex.Text = "保密"; } switch (penson.Marriage.Trim()) { case "": this.RadlMarriage.Text = "保密"; break; case "0": this.RadlMarriage.Text = "保密"; break; case "1": this.RadlMarriage.Text = "离婚"; break; case "2": this.RadlMarriage.Text = "已婚"; break; case "3": this.RadlMarriage.Text = "离异"; break; } this.DpkBirthday.Text = penson.Birthday.ToString(); this.TxtIDCard.Text = penson.Id_Code; this.TxtNativePlace.Text = penson.Native; this.TxtNation.Text = penson.Nation; this.DropEducation.Text = penson.Education; this.TxtGraduateFrom.Text = penson.Finish_School; this.TxtInterestsOfLife.Text = penson.Life_Love; this.TxtInterestsOfCulture.Text = penson.Cultrue_Love; this.TxtInterestsOfOther.Text = penson.Other_Love; this.TxtInterestsOfSport.Text = penson.Sport_Love; this.TxtInterestsOfAmusement.Text = penson.FUN_Love; this.DropIncome.Text = penson.Income.ToString(); this.TxtFamily.Text = penson.Home_Circs; this.TxtAim.Text = penson.Aim_Code; this.TxtFax.Text = penson.Fax_phone; this.TxtAddress.Text = penson.Message_Address; this.TxtOfficePhone.Text = penson.Work_Phone; this.TxtHomePhone.Text = penson.Home_Phone; this.TxtMobile.Text = penson.Telephone; this.TxtPHS.Text = penson.Little_Smart; this.TxtHomepage.Text = penson.Homepage; this.TxtEmail.Text = penson.Email_Address; this.TxtQQ.Text = penson.QQ_Code; this.TxtMSN.Text = penson.MSN_Code; this.TxtUC.Text = penson.UC_Code; this.TxtYahoo.Text = penson.YaoHu_Code; this.TxtICQ.Text = penson.ICQ_Code; this.TxtZipCodeW.Text = penson.ZipCodeW; this.country.Text = penson.country; this.province.Text = penson.province; this.city.Text = penson.city; scriptname = "document.getElementById(\"country\").value = \"" + penson.country + "\";"; scriptname += "document.getElementById(\"province\").value = \"" + penson.province + "\";province_onchange(province,city);"; scriptname += "document.getElementById(\"city\").value = \"" + penson.city + "\";"; } } } //DataTable tt = bpt.SelectByName(this.Pro_name); int typeid = DataConverter.CLng(Request.QueryString["type"]); if (typeid != 0) { //tt = bpt.SelectByName(this.Pro_name); } //if (tt != null) //{ // tt.DefaultView.Sort = "ID desc"; // Bind(tt); //} Call.SetBreadCrumb(Master, "<li>CRM管理</li><li><a href='CustomerList.aspx?usertype=0'>客户管理</a></li><li>" + Label1.Text + "</li>"); }
//提交 protected void Commit_Click(object sender, EventArgs e) { //mps.Name = Request.Form["TxtProjectName"]; //mps.TypeID =Convert.ToInt32( Request.Form["DDList"]); //mps.Price = DataConverter.CDecimal(Request.Form["TxtProjectPrice"]); //mps.Requirements = Request.Form["TxtProjectRequire"]; //mps.ApplicationTime =DataConverter.CDate( DateTime.Now.ToString()); //mps.BeginTime = DateTime.MaxValue; //mps.CompletionTime = DateTime.MaxValue; //获取用户信息xml储存 string str = "<Info>"; str += "<item id=\"name\">" + this.TxtUserName.Text.Trim() + "</item>"; str += "<item id=\"company\">" + this.TxtUserCompany.Text.Trim() + "</item>"; str += "<item id=\"tel\">" + this.TxtUserTel.Text.Trim() + "</item>"; str += "<item id=\"mobile\">" + this.TxtUserMobile.Text.Trim() + "</item>"; str += "<item id=\"qq\">" + this.TxtUserQQ.Text.Trim() + "</item>"; str += "<item id=\"msn\">" + this.TxtUserMSN.Text.Trim() + "</item>"; str += "<item id=\"address\">" + this.TxtUserAddress.Text.Trim() + "</item>"; str += "<item id=\"email\">" + this.TxtUserEmail.Text.Trim() + "</item>"; str += "</Info>"; //mps.AuditStatus = 1; //mps.UserInfo = str; //int id = bps.GetInsert(mps); if (this.TxtUserName.Text.Trim() != "") { B_Client_Basic bll = new B_Client_Basic(); B_Client_Penson pll = new B_Client_Penson(); DataTable tbles = bll.SelByName(this.TxtUserName.Text.Trim()); if (tbles.Rows.Count == 0) { string Code = function.GetFileName(); M_Client_Basic baseinfo = new M_Client_Basic(); baseinfo.P_name = this.TxtUserName.Text.Trim(); baseinfo.Client_Type = "0"; baseinfo.Add_Date = DateTime.Now; baseinfo.Code = Code; //baseinfo.Unit_Address = this.TxtUserCompany.Text.Trim(); bll.GetInsert(baseinfo); M_Client_Penson pinfo = new M_Client_Penson(); pinfo.Fax_phone = this.TxtUserTel.Text.Trim(); pinfo.Email_Address = this.TxtUserEmail.Text.Trim(); pinfo.MSN_Code = this.TxtUserMSN.Text.Trim(); pinfo.Message_Address = this.TxtUserAddress.Text.Trim(); pinfo.QQ_Code = this.TxtUserQQ.Text.Trim(); pinfo.Work_Phone = this.TxtUserMobile.Text.Trim(); pinfo.Code = Code; pinfo.Birthday = DateTime.Now; pll.GetInsert(pinfo); } } //DataTable dt = bpf.Select_All(); DataTable table = new DataTable(); table.Columns.Add(new DataColumn("FieldName", typeof(string))); table.Columns.Add(new DataColumn("FieldType", typeof(string))); table.Columns.Add(new DataColumn("FieldValue", typeof(string))); //if (dt != null) //{ // //获取自定义字段的列表 // foreach (DataRow dr in dt.Rows) // { // if (DataConverter.CBool(dr["IsNotNull"].ToString())) // { // if (string.IsNullOrEmpty(this.Page.Request.Form["txt_" + dr["FieldName"].ToString()])) // { // function.WriteErrMsg(dr["FieldAlias"].ToString() + "不能为空!"); // } // } // if (dr["FieldType"].ToString() == "FileType") // { // string[] Sett = dr["Content"].ToString().Split(new char[] { ',' }); // bool chksize = DataConverter.CBool(Sett[0].Split(new char[] { '=' })[1]); // string sizefield = Sett[1].Split(new char[] { '=' })[1]; // if (chksize && sizefield != "") // { // DataRow row2 = table.NewRow(); // row2[0] = sizefield; // row2[1] = "FileSize"; // row2[2] = this.Page.Request.Form["txt_" + sizefield]; // table.Rows.Add(row2); // } // } // if (dr["FieldType"].ToString() == "MultiPicType") // { // string[] Sett = dr["Content"].ToString().Split(new char[] { ',' }); // bool chksize = DataConverter.CBool(Sett[0].Split(new char[] { '=' })[1]); // string sizefield = Sett[1].Split(new char[] { '=' })[1]; // if (chksize && sizefield != "") // { // if (string.IsNullOrEmpty(this.Page.Request.Form["txt_" + sizefield])) // { // function.WriteErrMsg(dr["FieldAlias"].ToString() + "的缩略图不能为空!"); // } // DataRow row1 = table.NewRow(); // row1[0] = sizefield; // row1[1] = "ThumbField"; // row1[2] = this.Page.Request.Form["txt_" + sizefield]; // table.Rows.Add(row1); // } // } // DataRow row = table.NewRow(); // row[0] = dr["FieldName"].ToString(); // string ftype = dr["FieldType"].ToString(); // row[1] = ftype; // string fvalue = this.Page.Request.Form["txt_" + dr["FieldName"].ToString()]; // if (ftype == "TextType" || ftype == "MultipleTextType" || ftype == "MultipleHtmlType") // { // fvalue = sll.ProcessSen(fvalue); // } // row[2] = fvalue; // table.Rows.Add(row); // } //} //显示自定义字段 if (table != null) { if (table.Rows.Count > 0) { //int id = bps.GetInsert(mps); //bps.InsertModel(table, "ZL_ProjectsBase",id); } } if (Request.Form["project"] != null) { string project = Request.Form["project"]; string projectname = Request.Form["projectname"]; if (project.IndexOf(",") > -1) { string[] arrlist = project.Split(new string[] { "," }, StringSplitOptions.None); //value string[] namelist = projectname.Split(new string[] { "," }, StringSplitOptions.None); //name for (int i = 0; i < arrlist.Length; i++) { //arrlist[i]; //M_Processes processesinfo = new M_Processes(); //processesinfo.Info = ""; //processesinfo.IsComplete = 0; //processesinfo.CompleteTime = DateTime.Now; //processesinfo.Name = namelist[i].ToString(); ////processesinfo.OpjectID = id; //processesinfo.Progress = DataConverter.CLng(arrlist[i]); //pll.GetInsert(processesinfo); } } } function.WriteSuccessMsg("操作成功!", "Projects.aspx"); }
//确定按钮 protected void btnTrue_Click(object sender, EventArgs e) { int id = DataConverter.CLng(Request.QueryString["id"]); M_UserInfo userinfo = Uinfo.GetUserByUserID(id); M_Uinfo users = Uinfo.GetUserBaseByuserid(id); B_Client_Basic bsc = new B_Client_Basic(); M_Client_Basic client = new M_Client_Basic(); if (rbSelect.SelectedValue.Trim().Equals("3")) //取消升级 { Response.Redirect("Userinfo.aspx?id=" + id); } if (rbSelect.SelectedValue.Trim().Equals("2")) //覆盖客户 { //通过客户姓名获取客户信息 DataTable dt = bsc.SelByName(userinfo.UserName.Trim()); if (dt != null) //如果找不到客户则升级 { client.Flow = DataConverter.CLng(dt.Rows[0]["Flow"]); //client.Client_Source = "在线注册"; //client.Client_Area = users.Province; client.P_name = userinfo.UserName; client.Add_Date = DateTime.Now; client.Code = dt.Rows[0]["Code"].ToString(); //client.Add_Name = users.TrueName; client.Title = "在线注册"; M_Client_Penson person = new M_Client_Penson(); B_Client_Penson bperson = new B_Client_Penson(); person = bperson.GetPenSonByCode(client.Code.Trim()); if (person == null || person.Flow == 0) { person.Code = client.Code; } person.Birthday = DataConverter.CDate(users.BirthDay); person.city = users.County; person.country = users.Country; person.Fax_phone = users.Fax; person.Home_Phone = users.HomePhone; person.Homepage = users.HomePage; person.ICQ_Code = users.ICQ; person.Id_Code = users.IDCard; person.MSN_Code = users.MSN; person.Native = users.Province; person.province = users.County; person.QQ_Code = users.QQ; person.Telephone = users.Mobile; person.UC_Code = users.UC; person.Work_Phone = users.OfficePhone; person.YaoHu_Code = users.Yahoo; person.ZipCodeW = users.ZipCode; person.Code = client.Code.Trim(); if (person.Flow == 0) { if (bsc.GetUpdate(client) && bperson.GetInsert(person)) { function.WriteSuccessMsg("覆盖升级成功,请进入客户管理系统管理客户信息!", "../user/Userinfo.aspx?id=" + id); } else { function.WriteErrMsg("操作失败,请重试或检查操作错误!"); } } else { if (bsc.GetUpdate(client) && bperson.GetUpdate(person)) { function.WriteSuccessMsg("覆盖升级成功,请进入客户管理系统管理客户信息!", "../user/Userinfo.aspx?id=" + id); } else { function.WriteErrMsg("操作失败,请重试或检查操作错误!"); } } } if (dt != null) { dt.Dispose(); } } if (rbSelect.SelectedValue.Trim().Equals("1"))//系统修改姓名,随机生成数字 { //client.Client_Source = "在线注册"; //client.Client_Area = users.Province; Random ro = new Random(); int resu = ro.Next(100000); client.P_name = userinfo.UserName + resu.ToString(); client.Add_Date = DateTime.Now; client.Code = DataSecurity.MakeFileRndName().ToString(); //client.Add_Name = users.TrueName; client.Title = "在线注册"; M_Client_Penson person = new M_Client_Penson(); B_Client_Penson bperson = new B_Client_Penson(); person.Code = client.Code.Trim(); person.Birthday = DataConverter.CDate(users.BirthDay); person.city = users.County; person.country = users.Country; person.Fax_phone = users.Fax; person.Home_Phone = users.HomePhone; person.Homepage = users.HomePage; person.ICQ_Code = users.ICQ; person.Id_Code = users.IDCard; person.MSN_Code = users.MSN; person.Native = users.Province; person.province = users.County; person.QQ_Code = users.QQ; person.Telephone = users.Mobile; person.UC_Code = users.UC; person.Work_Phone = users.OfficePhone; person.YaoHu_Code = users.Yahoo; person.ZipCodeW = users.ZipCode; if (bsc.GetInsert(client) && bperson.GetInsert(person)) { function.WriteSuccessMsg("升级成功,您的名称为:" + client.P_name + ",请进入客户管理系统查看客户信息!", "../user/Userinfo.aspx?id=" + id); } else { function.WriteErrMsg("操作失败,请重试或检查操作错误!"); } } }
public bool GetUpdate(M_Client_Basic model) { return(Sql.UpdateByIDs(TbName, "Flow", model.Flow.ToString(), BLLCommon.GetFieldAndPara(model), model.GetParameters(model))); }
public bool GetInsert(M_Client_Basic model) { return(Sql.insert(TbName, model.GetParameters(model), BLLCommon.GetParas(model), BLLCommon.GetFields(model)) > 0); }
public int insert(M_Client_Basic model) { return(Sql.insertID(TbName, model.GetParameters(model), BLLCommon.GetParas(model), BLLCommon.GetFields(model))); }