protected void Button3_Click(object sender, EventArgs e) { Dictionary <string, string> d = ViewState["DateAreas"] as Dictionary <string, string>; if (d != null) { Dictionary <string, string> dictionary = new Dictionary <string, string>(); string value = ""; foreach (KeyValuePair <string, string> kvp in d) { string[] area = kvp.Key.Split('|'); string sID = area[0]; string eID = area[1]; string sValue = ""; string eValue = ""; if (this.Request.Form["ctl00$PageBody$" + sID] == null) { sValue = this.Request.Form["ctl00$PageBody$S_Area_dtDate_Input" + sID].ToString(); } else { sValue = this.Request.Form["ctl00$PageBody$" + sID].ToString(); } if (this.Request.Form["ctl00$PageBody$" + eID] == null) { eValue = this.Request.Form["ctl00$PageBody$E_Area_dtDate_Input" + eID].ToString(); } else { eValue = this.Request.Form["ctl00$PageBody$" + eID].ToString(); } value = value + sValue + "|" + eValue + ","; dictionary.Add(kvp.Key, sValue + "|" + eValue); } ViewState["DateAreas"] = dictionary; if (value != "") { value = value.Substring(0, value.Length - 1); tsSysParamEntity tsSysParam = new tsSysParamEntity(); tsSysParam.ID = 1000; tsSysParam.Name = ""; tsSysParam.Value = value; tsSysParam.Comment = ""; tsSysParam.DataTable_Action_ = DataTable_Action.Update; int result = BusinessFacadeDLT.tsSysParamInsertUpdateDelete(tsSysParam); if (result > 0) { Response.Write("<script language='javascript'>alert('保存成功!');</script>"); DataBindArea(); } else { Response.Write("<script language='javascript'>alert('保存失败!');</script>"); } } } }
/// <summary> /// 增加/修改事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button1_Click(object sender, EventArgs e) { string tsSysParam_Name_Value = (string)Common.sink(tsSysParam_Name_Input.UniqueID, MethodType.Post, 50, 1, DataType.Str); string tsSysParam_Value_Value = (string)Common.sink(tsSysParam_Value_Input.UniqueID, MethodType.Post, 2048, 1, DataType.Str); string tsSysParam_Comment_Value = (string)Common.sink(tsSysParam_Comment_Input.UniqueID, MethodType.Post, 512, 0, DataType.Str); tsSysParamEntity ut = BusinessFacadeDLT.tsSysParamDisp(IDX); ut.Name = tsSysParam_Name_Value; ut.Value = tsSysParam_Value_Value; ut.Comment = tsSysParam_Comment_Value; if (CMD == "New") { ut.DataTable_Action_ = DataTable_Action.Insert; } else if (CMD == "Edit") { ut.DataTable_Action_ = DataTable_Action.Update; } else { EventMessage.MessageBox(2, "不存在操作字符串!", "不存在操作字符串!", Icon_Type.Error, Common.GetHomeBaseUrl("Default.aspx")); } Int32 rInt = BusinessFacadeDLT.tsSysParamInsertUpdateDelete(ut); if (rInt > 0) { string OpTxt = string.Format("增加系统参数成功!(ID:{0})", rInt); if (ut.DataTable_Action_ == DataTable_Action.Update) { OpTxt = string.Format("修改系统参数成功!(ID:{0})", IDX); } EventMessage.MessageBox(1, "操作成功", OpTxt, Icon_Type.OK, Common.GetHomeBaseUrl("Default.aspx")); } else if (rInt == -2) { EventMessage.MessageBox(1, "操作失败", "操作失败,存在相同的键值(用户名/数据)!", Icon_Type.Alert, Common.GetHomeBaseUrl("Default.aspx")); } else { EventMessage.MessageBox(1, "操作失败", string.Format("操作失败,返回值:{0}!", rInt), Icon_Type.Error, Common.GetHomeBaseUrl("Default.aspx")); } }
/// <summary> /// 开始操作 /// </summary> private void OnStart() { tsSysParamEntity ut = BusinessFacadeDLT.tsSysParamDisp(IDX); OnStartData(ut); switch (CMD) { case "New": TabOptionItem1.Tab_Name = HeadMenuWebControls1.HeadOPTxt = "增加系统参数"; Hidden_Disp(); break; case "List": TabOptionItem1.Tab_Name = HeadMenuWebControls1.HeadOPTxt = "查看系统参数"; Hidden_Input(); ButtonOption.Visible = false; AddEditButton(); break; case "Edit": TabOptionItem1.Tab_Name = HeadMenuWebControls1.HeadOPTxt = "修改系统参数"; Hidden_Disp(); AddDeleteButton(); break; case "Delete": ut.DataTable_Action_ = DataTable_Action.Delete; if (BusinessFacadeDLT.tsSysParamInsertUpdateDelete(ut) > 0) { EventMessage.MessageBox(1, "删除成功", string.Format("删除ID:{0}成功!", IDX), Icon_Type.OK, Common.GetHomeBaseUrl("Default.aspx")); } else { EventMessage.MessageBox(1, "删除失败", string.Format("删除ID:{0}失败!", IDX), Icon_Type.Error, Common.GetHomeBaseUrl("Default.aspx")); } break; default: EventMessage.MessageBox(2, "不存在操作字符串!", "不存在操作字符串!", Icon_Type.Error, Common.GetHomeBaseUrl("Default.aspx")); break; } }
protected void Button2_Click(object sender, EventArgs e) { string Checkbox_Value = (string)Common.sink("Checkbox", MethodType.Post, 2000, 1, DataType.Str); string[] Checkbox_Value_Array = Checkbox_Value.Split(','); Int32 IDX = 0; for (int i = 0; i < Checkbox_Value_Array.Length; i++) { if (Int32.TryParse(Checkbox_Value_Array[i], out IDX)) { tsSysParamEntity et = new tsSysParamEntity(); et.DataTable_Action_ = DataTable_Action.Delete; et.ID = IDX; BusinessFacadeDLT.tsSysParamInsertUpdateDelete(et); } } EventMessage.MessageBox(1, "批量删除成功", string.Format("批量删除({0})成功!", Checkbox_Value), Icon_Type.OK, Common.GetHomeBaseUrl("default.aspx")); }
/// <summary> /// 初始化数据 /// </summary> /// <param name="ut"></param> private void OnStartData(tsSysParamEntity ut) { tsSysParam_Name_Input.Text = tsSysParam_Name_Disp.Text = ut.Name.ToString(); tsSysParam_Value_Input.Text = tsSysParam_Value_Disp.Text = ut.Value.ToString(); tsSysParam_Comment_Input.Text = tsSysParam_Comment_Disp.Text = ut.Comment.ToString(); }
protected void Button3_Click(object sender, EventArgs e) { int CustomerID = 0; string UserID = ""; if (TextBox1.Text == "") { Response.Write("<script language='javascript'>alert('请输入客服ID');</script>"); return; } else { if (UserData.Get_sys_UserTable1(TextBox1.Text) != null) { CustomerID = UserData.Get_sys_UserTable1(TextBox1.Text).UserID; } else { Response.Write("<script language='javascript'>alert('客服ID输入错误!');</script>"); return; } } if (TextBox2.Text == "") { Response.Write("<script language='javascript'>alert('请输入上家ID');</script>"); return; } else { string[] postIDList = TextBox2.Text.Split(','); ArrayList arr = new ArrayList(); for (int i = 0; i < postIDList.Length; i++) { if (IsUIDTrue(postIDList[i].ToString()) != "-1") { arr.Add(postIDList[i].ToString()); UserID += IsUIDTrue(postIDList[i].ToString()) + ","; } } //UserID去除最后一个逗号 UserID = UserID.Substring(0, UserID.Length - 1); } if (AllAppointArbitration() != "") { ArrayList arrAll = new ArrayList(); string[] allUserIDList = AllAppointArbitration().Split(','); for (int j = 0; j < allUserIDList.Length; j++) { arrAll.Add(allUserIDList[j].ToString()); } string[] idList = UserID.Split(','); string tmpStr = ""; for (int k = 0; k < idList.Length; k++) { if (arrAll.Contains(idList[k])) { continue; } else { tmpStr += idList[k].ToString() + ","; } } if (tmpStr != "") { tmpStr = tmpStr.Substring(0, tmpStr.Length - 1); string result = AllAppointArbitration() + "," + tmpStr; //更新result到sysparam tsSysParamEntity ut = BusinessFacadeDLT.tsSysParamDisp(1027); ut.Value = result; ut.DataTable_Action_ = DataTable_Action.Update; BusinessFacadeDLT.tsSysParamInsertUpdateDelete(ut); } } else { //更新result到sysparam tsSysParamEntity ut = BusinessFacadeDLT.tsSysParamDisp(1027); ut.Value = UserID; ut.DataTable_Action_ = DataTable_Action.Update; BusinessFacadeDLT.tsSysParamInsertUpdateDelete(ut); } if (UserID == "") { Response.Write("<script language='javascript'>alert('输入的上家ID有误,请重新输入上家ID');</script>"); return; } DataSet ds = BusinessFacadeDLT.AddAppointArbitration(CustomerID.ToString(), UserID, Common.Get_UserID); if (ds != null) { if (ds.Tables[0].Rows[0][0].ToString() == "-1") { Response.Write("<script language='javascript'>alert('此客服已存在于列表,请直接更新!');</script>"); } else { Response.Write("<script language='javascript'>alert('添加成功!');</script>"); BindDataList(); } } }
protected void Button2_Click(object sender, EventArgs e) { string Checkbox_Value = (string)Common.sink("Checkbox", MethodType.Post, 2000, 1, DataType.Str); string[] Checkbox_Value_Array = Checkbox_Value.Split(','); Int32 IDX = 0; for (int i = 0; i < Checkbox_Value_Array.Length; i++) { if (Int32.TryParse(Checkbox_Value_Array[i], out IDX)) { tbAppointArbitrationEntity et = new tbAppointArbitrationEntity(); tbAppointArbitrationEntity ut = BusinessFacadeDLT.tbAppointArbitrationDisp(IDX); //删除sysparam QueryParam qp = new QueryParam(); qp.OrderType = 0; int RecordCount = 0; qp.Where = " Where [ID]<>" + IDX.ToString() + ""; List <tbAppointArbitrationEntity> lst = BusinessFacadeDLT.tbAppointArbitrationList(qp, out RecordCount); string[] arr = null; string[] arrUserID = null; ArrayList delList = new ArrayList(); if (ut.UserID.IndexOf(',') > 0) { arrUserID = ut.UserID.Split(','); } else { arrUserID = new string[] { ut.UserID.ToString() }; } for (int x = 0; x < arrUserID.Length; x++) { delList.Add(arrUserID[x].ToString()); } for (int j = 0; j < lst.Count; j++) { if (lst[j].UserID.IndexOf(',') > 0) { arr = lst[j].UserID.Split(','); } else { arr = new string[] { lst[j].UserID.ToString() }; } for (int k = 0; k < arr.Length; k++) { if (delList.Contains(arr[k])) { delList.Remove(arr[k]); } } } if (delList.Count > 0) { //有需要删除sysparam,需要获取 string s = ""; string[] sysParam = null; tsSysParamEntity ut1 = BusinessFacadeDLT.tsSysParamDisp(1027); if (ut1.Value.IndexOf(',') > 0) { sysParam = ut1.Value.Split(','); ArrayList arrSysParam = new ArrayList(); for (int z = 0; z < sysParam.Length; z++) { arrSysParam.Add(sysParam[z]); } for (int m = 0; m < delList.Count; m++) { if (arrSysParam.Contains(delList[m])) { arrSysParam.Remove(delList[m]); } } for (int n = 0; n < arrSysParam.Count; n++) { s += arrSysParam[n].ToString() + ","; } if (s != "") { s = s.Substring(0, s.Length - 1); } tsSysParamEntity ut3 = BusinessFacadeDLT.tsSysParamDisp(1027); ut3.Value = s; ut3.DataTable_Action_ = DataTable_Action.Update; BusinessFacadeDLT.tsSysParamInsertUpdateDelete(ut3); } } et.DataTable_Action_ = DataTable_Action.Delete; et.ID = IDX; BusinessFacadeDLT.tbAppointArbitrationInsertUpdateDelete(et); } } EventMessage.MessageBox(1, "批量删除成功", string.Format("批量删除({0})成功!", Checkbox_Value), Icon_Type.OK, Common.GetHomeBaseUrl("default.aspx")); }