void button1_Click(object sender, EventArgs e) { if (FrameLib.CheckData(this.button1)) { BigStationBU.SetBigList(this.num.Text, this.bigname.Text); } }
/// <summary> /// 将视图状态中的数据进行提交 /// 1、判断是否有删除的数据,如果有,则删除 /// 2、判断是否有新增的数据,如果有,则新增 /// 3、剔除PARENTGUID为-1的数据 /// </summary> public void Submit() { DataTable dt1 = this.AttachmentList; JTable tab1 = new JTable(this.TableName); List <SearchField> condition = new List <SearchField>(); Dictionary <String, object> dic1 = new Dictionary <string, object>(); foreach (DataRow dr1 in dt1.Rows) { if (dr1["PARENTGUID"].ToString() != "-1") { if (dr1["DataStatus"].ToString() == "deletedata") //需要删除数据 { //删除文件 if (String.IsNullOrEmpty(dr1["FILEDIR"].ToString()) == false && String.IsNullOrEmpty(dr1["ENCRYPTFILENAME"].ToString()) == false) { String fileName = dr1["FILEDIR"].ToString() + dr1["ENCRYPTFILENAME"].ToString(); fileName = Server.MapPath(fileName); if (File.Exists(fileName)) { File.Delete(fileName); } } //删除数据库中的相关数据 condition.Clear(); condition.Add(new SearchField("GUIDID", dr1["GUIDID"].ToString())); dic1.Clear(); dic1["DEL"] = "1"; //逻辑删除数据 tab1.EditData(dic1, condition); //tab1.DeleteData(condition); } if (dr1["DataStatus"].ToString() == "newdata") //表示新增数据 { //将文件名改名,去掉$$符号 if (String.IsNullOrEmpty(dr1["FILEDIR"].ToString()) == false && String.IsNullOrEmpty(dr1["ENCRYPTFILENAME"].ToString()) == false) { String fileName = dr1["FILEDIR"].ToString() + dr1["ENCRYPTFILENAME"].ToString(); String fileName1 = dr1["FILEDIR"].ToString() + dr1["ENCRYPTFILENAME"].ToString().Replace("$$", ""); fileName = Server.MapPath(fileName); fileName1 = Server.MapPath(fileName1); File.Copy(fileName, fileName1); File.Delete(fileName); } //更新数据中的数据 dic1.Clear(); dic1 = FrameLib.GetDictionaryByDataRow(dr1); dic1["ENCRYPTFILENAME"] = dic1["ENCRYPTFILENAME"].ToString().Replace("$$", ""); dic1.Remove("DataStatus"); tab1.InsertData(dic1); } } } tab1.Close(); }
void button1_Click(object sender, EventArgs e) { if (FrameLib.CheckData(button1)) { JTable tab1 = new JTable("MYUSERNAME"); Control[] con1 = new Control[] { num, password, UserName }; Dictionary <String, object> data1 = JControl.GetControlValuesToDictionary(con1); List <SearchField> condition = new List <SearchField>(); condition.Add(new SearchField("UserName", this.UserName.Text)); if (this.isAdmin.Checked) { data1.Add("isAdmin", "1"); } else { data1.Add("isAdmin", "0"); } tab1.EditData(data1, condition, true); tab1.Close(); //更新角色中的相关数据 JTable tab2 = new JTable(); tab2.TableName = "JROLEUSERS"; condition.Clear(); condition.Add(new SearchField("RoleID", "001")); condition.Add(new SearchField("UserID", this.UserName.Text.Trim())); DataTable dt1 = tab2.SearchData(condition, -1, "*").Tables[0]; if (this.isAdmin.Checked) { if (dt1.Rows.Count == 0) { DataRow dr1 = dt1.NewRow(); dr1["num"] = 1; dr1["id"] = WebFrame.Util.JString.GetUnique32ID(); dr1["userid"] = this.UserName.Text.Trim(); dr1["roleid"] = "001"; dt1.Rows.Add(dr1); tab2.Update(dt1); } } else { if (dt1.Rows.Count > 0) { DataRow dr1 = dt1.Rows[0]; dr1.Delete(); tab2.Update(dt1); } } tab2.Close(); JAjax.AlertAndGoUrl("提示:操作成功", button1.UrlReferrer); } }
//提交密码修改 protected void but1_Click(object sender, EventArgs e) { if (FrameLib.CheckData(this.but1)) { MyUserName bu1 = new MyUserName(); bool succ = bu1.UpdatePassWord(Page.User.Identity.Name, this.oldPass.Text, this.password1.Text); if (succ == false) { JAjax.Alert("错误:老密码输入不正确,请检查后重新输入!"); } else { JAjax.AlertAndGoUrl("提示:密码已成功修改,你需要重新登录!", "/SignOut.aspx"); } } }
void button1_Command(object sender, CommandEventArgs e) { if (FrameLib.CheckData(button1)) { button1.ExecutePara.Success = true; if (button1.ExecutePara.Success) { button1.JButtonType = JButtonType.SimpleAction; FrameLib.ExecuteJButton(button1); } else { FrameLib.ExecuteButtonInfo(button1); } } }
void button1_Click(object sender, EventArgs e) { if (FrameLib.CheckData(this.button1)) { Dictionary <String, object> data1 = new Dictionary <string, object>(); data1["num"] = this.num.Text.Trim(); data1["lineid"] = Request.QueryString["LineID"]; data1["linename"] = this.LineName.Text.Trim(); data1["jiaolu"] = this.JiaoLu.Text; if (this.fee1.Text.Trim() != String.Empty) { data1["fee1"] = int.Parse(this.fee1.Text.Trim()); } else { data1["fee1"] = 0; } if (this.fee2.Text.Trim() != String.Empty) { data1["fee2"] = int.Parse(this.fee2.Text.Trim()); } else { data1["fee2"] = 0; } ChangJiaoFeeBU bu1 = new ChangJiaoFeeBU(); bool succ = bu1.UpdateData(data1); this.button1.ExecutePara.Success = succ; FrameLib.ExecuteButtonInfo(this.button1); } }
/// <summary> /// 新增一条数据 /// </summary> /// <param name="data1"></param> public void NewData(DataRow data1) { Dictionary <string, object> data2 = FrameLib.GetDictionaryByDataRow(data1); NewData(data2); }
void button1_Command(object sender, CommandEventArgs e) { if (FrameLib.CheckData(button1)) { button1.ExecutePara.Success = true; if (this.Line.Text.Trim() != String.Empty) { //检查线路的配置是否正确 String traintype = this.TrainType.Text.Trim(); ETrainType type1 = ETrainType.空调车25T; if (traintype == "动车组") { type1 = ETrainType.动车CRH2A; } else if (traintype == "空调特快") { type1 = ETrainType.空调车25T; } else if (traintype == "空调快速") { type1 = ETrainType.空调车25G; } else if (traintype == "空调普快") { type1 = ETrainType.空调车25G; } else if (traintype == "快速") { type1 = ETrainType.空调车25K; } else if (traintype == "普快") { type1 = ETrainType.绿皮车25B; } String[] lineNodes = this.Line.Text.Trim().Replace("-", ",").Split(','); TrainLine lineObj = BusinessRule.Line.GetTrainLineByTrainTypeAndLineNoeds(type1, false, lineNodes); if (lineObj != null) { if (lineObj.TotalMiles + "" != this.Mile.Text.Trim()) { button1.ExecutePara.Success = false; button1.ExecutePara.FailInfo = "错误:线路的距离设置错误,应为(" + lineObj.TotalMiles + "公里)!"; } } else { button1.ExecutePara.Success = false; button1.ExecutePara.FailInfo = "错误:线路的配置不对或线路不存在!"; } } if (button1.ExecutePara.Success) { button1.JButtonType = JButtonType.SimpleAction; FrameLib.ExecuteJButton(button1); } else { FrameLib.ExecuteButtonInfo(button1); } } }