//提交数据的代码 void btnSubmit_ServerClick(object sender, EventArgs e) { String error = String.Empty; Control con1 = bean1.CheckControls(out error); //进行数据验证 if (con1 != null) { UTools.Alert(error); } else { JUserBU bu1 = new JUserBU(); String olduserid = String.Empty; if (this.UserID.Enabled == false) { olduserid = this.UserID.Text; } int succ = bu1.SaveData(olduserid, this.Num.Text, this.UserID.Text, this.UserName.Text, this.Status.SelectedValue, this.AuthorityID.SelectedValue, ""); if (succ == 1) //submit succ { String js1 = "layer.alert('操作成功!',function(index){;"; js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);"; js1 = js1 + " parent.$('#butSearch').click();"; js1 = js1 + " parent.layer.close(index);});"; JAjax.ExecuteJS(js1); } else { UTools.Alert("操作失败,请重试!"); } } }
//提交数据的代码 void btnSubmit_ServerClick(object sender, EventArgs e) { String error = String.Empty; //设置父编码的值 this.Parent.Text = this.Parent1.SelectedValue; Control con1 = bean1.CheckControls(out error); //后台进行数据验证 if (con1 != null) { UTools.Alert(error); } else { int succ = bean1.SaveDataToDb(); if (succ == 1) //submit succ { String js1 = "layer.alert('操作成功!',function(index){;"; js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);"; js1 = js1 + " parent.$('#butSearch').click();"; js1 = js1 + " parent.layer.close(index);});"; JAjax.ExecuteJS(js1); } else { UTools.Alert("操作失败,请重试!"); } } }
public override void RegisterAILogic() { TimerSev.Instance.AddTimerTask((tid) => { TickAILogic(); }, checkTime - UTools.RDInt(100, 500), 0); }
//提交数据的代码 void btnSubmit_ServerClick(object sender, EventArgs e) { String error = String.Empty; //设置父编码的值 Control con1 = bean1.CheckControls(out error); //后台进行数据验证 if (con1 != null) { UTools.Alert(error); } else { Dictionary <String, object> dic1 = bean1.GetControlValues(); int succ = bean1.SaveDataToDb(dic1); if (succ == 1) //submit succ { String js1 = "layer.alert('操作成功!',function(index){;"; js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);"; js1 = js1 + " parent.$('#butSearch').click();"; js1 = js1 + " parent.layer.close(index);});"; JAjax.ExecuteJS(js1); } else { //Response.Write(bean1.MyException.ToString()); UTools.Alert("操作失败,请重试!"); } } }
//提交数据 void btnSubmit_ServerClick(object sender, EventArgs e) { String taskid = Request.QueryString["TaskID"]; if (String.IsNullOrEmpty(taskid) == false && WebFrame.Util.JValidator.IsDateTime(this.PlanDate.Text)) { String doman = this.ExecuteManID.SelectedValue; string doman1 = this.ExecuteManID.SelectedItem.Text; Tb_TaskBU bu1 = new Tb_TaskBU(); bool succ1 = bu1.JieDanTask(taskid, doman, doman1, this.PlanDate.Text); if (succ1) //submit succ { String js1 = "layer.alert('操作成功!',function(index){;"; js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);"; js1 = js1 + " parent.$('#butSearch').click();"; js1 = js1 + " parent.layer.close(index);});"; JAjax.ExecuteJS(js1); } else { UTools.Alert("操作失败,请重试!"); } } else { UTools.Alert("操作失败,可能的原因是数据类型错误!"); } }
//提交数据的代码 void btnSubmit_ServerClick(object sender, EventArgs e) { String error = String.Empty; //设置父编码的值 Control con1 = bean1.CheckControls(out error); //后台进行数据验证 if (con1 != null) { UTools.Alert(error); } else { Dictionary <String, object> dic1 = bean1.GetControlValues(); dic1["AuthorityGroup"] = WebFrame.FrameLib.AuthorityGroup; dic1["[PassWord]"] = "123456"; dic1["LoginCount"] = 0; int succ = bean1.SaveDataToDb(dic1); if (succ == 1) //submit succ { String js1 = "layer.alert('操作成功!',function(index){;"; js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);"; js1 = js1 + " parent.$('#butSearch').click();"; js1 = js1 + " parent.layer.close(index);});"; JAjax.ExecuteJS(js1); } else { UTools.Alert("操作失败,请重试!"); } } }
//提交数据的代码 void btnSubmit_ServerClick(object sender, EventArgs e) { String error = String.Empty; Control con1 = bean1.CheckControls(out error); //后台进行数据验证 if (con1 != null) { UTools.Alert(error); } else { int succ = bean1.SaveDataToDb(); if (succ == 1) //submit succ { String js1 = "layer.alert('操作成功!',function(index){;"; js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);"; js1 = js1 + " parent.$('#ctl00_ContentPlaceHolder1_butSearch2').click();"; js1 = js1 + " parent.layer.close(index);});"; JAjax.ExecuteJS(js1); } else { //throw bean1.MyException; UTools.Alert("操作失败,请重试!"); } } }
//提交数据的代码 void btnSubmit_ServerClick(object sender, EventArgs e) { String error = String.Empty; Control con1 = bean1.CheckControls(out error); //后台进行数据验证 if (con1 != null) { UTools.Alert(error); } else { Dictionary <string, object> dic1 = this.bean1.GetControlValues(); dic1["AddTime"] = DateTime.Now; dic1["AddUserID"] = WebFrame.FrameLib.UserID; dic1["AddUserName"] = WebFrame.FrameLib.UserName; int succ = bean1.SaveDataToDb(dic1); if (succ == 1) //submit succ { String js1 = "layer.alert('操作成功!',function(index){;"; js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);"; js1 = js1 + " parent.$('#ctl00_ContentPlaceHolder1_butSearch2').click();"; js1 = js1 + " parent.layer.close(index);});"; JAjax.ExecuteJS(js1); } else { //throw bean1.MyException; UTools.Alert("操作失败,请重试!"); } } }
//Submit data void button2_ServerClick(object sender, EventArgs e) { String itemName = Request.QueryString["Itemname"]; if (String.IsNullOrEmpty(itemName) == false) { String errorInfo = bill1.CheckData(); if (String.IsNullOrEmpty(errorInfo) == false) { //JAjax.Alert(errorInfo); UTools.Alert(errorInfo); } else { JItemDetailBU bu2 = new JItemDetailBU(); DataTable data = bill1.GetData(); String errorinfo = bu2.SaveItemData(itemName, data); if (String.IsNullOrEmpty(errorinfo) == false) { //JAjax.Alert(errorinfo); UTools.Alert(errorinfo); } else { String js1 = "layer.alert('操作成功!',function(index){;"; js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);"; js1 = js1 + " parent.$('#butSearch').click();"; js1 = js1 + " parent.layer.close(index);});"; JAjax.ExecuteJS(js1); } } } }
//提交工单信息 void btnSubmit_ServerClick(object sender, EventArgs e) { int succ = 0; WebFrame.Data.JConnect.GetConnect().BeginTrans(); try { String guidid = Request.QueryString["GuidID"]; Dictionary <string, object> dic1 = new Dictionary <string, object>(); Tb_TaskBU bu1 = new Tb_TaskBU(); //1--更新数据 List <SearchField> condition = new List <SearchField>(); condition.Add(new SearchField("Guidid", guidid)); String t1 = String.Empty; if (this.CheckResult.SelectedValue == "1") { dic1["LastWorkLoad"] = this.LastWorkload.Text; dic1["Status"] = "4"; t1 = "工单通过审核"; } else { dic1["Status"] = "1"; t1 = "工单未通过审核"; } bu1.EditData(condition, dic1); //2--创建日志 Tb_Task_LogBU bu2 = new Tb_Task_LogBU(); succ = bu2.NewLog(guidid, t1, this.Remark.Text, "0", this.file1); WebFrame.Data.JConnect.GetConnect().CommitTrans(); } catch (Exception err) { WebFrame.Data.JConnect.GetConnect().RollBackTrans(); succ = 0; WebFrame.Util.JTool.WriteErrorLog(err.ToString()); } if (succ == 1) //submit succ { String js1 = "layer.alert('操作成功!',function(index){;"; js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);"; js1 = js1 + " parent.$('#butSearch').click();"; js1 = js1 + " parent.layer.close(index);});"; JAjax.ExecuteJS(js1); } else { //throw bean1.MyException; UTools.Alert("操作失败,请重试!"); } }
//提交附件处理 void btnSubmit_ServerClick(object sender, EventArgs e) { if (this.file1.HasFile) { bool succ = false; try { Dictionary <String, object> dic1 = new Dictionary <string, object>(); dic1["guidID"] = this.guidID.Text; dic1["parentGuid"] = this.parentGuid.Text; dic1["FileName"] = Path.GetFileName(this.file1.FileName); dic1["UploadTime"] = DateTime.Now; dic1["UploadPerson"] = WebFrame.FrameLib.UserID; dic1["Describle"] = "项目进度安排的附件"; dic1["del"] = 0; dic1["FileDir"] = "/Attachment/UseAttachment/"; String ext1 = Path.GetExtension(this.file1.FileName); String truename1 = WebFrame.Util.JString.GetUnique32ID() + ext1; this.file1.SaveAs(Server.MapPath(dic1["FileDir"].ToString() + truename1)); dic1["EncryptFileName"] = dic1["FileDir"] + truename1; this.bean1.SaveDataToDb(dic1); succ = true; } catch (Exception err) { WebFrame.Util.JTool.WriteErrorLog(err.ToString()); } if (succ) //submit succ { String js1 = "layer.alert('操作成功!',function(index){;"; js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);"; js1 = js1 + " parent.$('#ctl00_ContentPlaceHolder1_butSearch2').click();"; js1 = js1 + " parent.layer.close(index);});"; JAjax.ExecuteJS(js1); } else { UTools.Alert("操作失败,请重试!"); } } else { UTools.Alert("提示:请选择一个要上传的附件!"); } }
//提交工单信息 void btnSubmit_ServerClick(object sender, EventArgs e) { int bugA = 0; int bugB = 0; int bugC = 0; int.TryParse(this.BugA.Text, out bugA); int.TryParse(this.BugB.Text, out bugB); int.TryParse(this.BugC.Text, out bugC); int succ1 = 0; if (bugA < 0 || bugB < 0 || bugC < 0 || (bugA + bugB + bugC) <= 0) { UTools.Alert("提示:请至少输入一个BUG数量!"); } else { try { String guidid = Request.QueryString["GuidID"]; Dictionary <string, object> dic1 = new Dictionary <string, object>(); Tb_Task_BugBU bu3 = new Tb_Task_BugBU(); succ1 = bu3.NewBug(guidid, bugA, bugB, bugC, 1, this.Remark.Text, this.file1); } catch (Exception err) { succ1 = 0; WebFrame.Util.JTool.WriteErrorLog(err.ToString()); } if (succ1 == 1) //submit succ { String js1 = "layer.alert('操作成功!',function(index){;"; js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);"; js1 = js1 + " parent.$('#butSearch').click();"; js1 = js1 + " parent.layer.close(index);});"; JAjax.ExecuteJS(js1); } else { //throw bean1.MyException; UTools.Alert("操作失败,请重试!"); } } }
public string GetRDNameData(bool man = true) { System.Random rd = new System.Random(); string rdName = surnameAr[UTools.RDInt(0, surnameAr.Length - 1)]; if (man) { rdName += manAr[UTools.RDInt(0, manAr.Length - 1)]; } else { rdName += womanAr[UTools.RDInt(0, womanAr.Length - 1)]; } return(rdName); }
protected void Page_Load(object sender, EventArgs e) { UTools.ClearCache(); if (!Page.IsPostBack) { String Action = Request["Action"]; String KeyID = Request["KeyID"]; String Remark = Request["Remark"]; String Result = "failer"; switch (Action) { case "Cancel_Tb_Task": //取消工单 Result = this.CancelTask(KeyID); break; case "JieDan_Tb_Task": //接单 String endDate = Request["endDate"]; Result = this.JieDanTask(KeyID, endDate); break; case "TuiTask_Tb_Task": //退单 Result = this.TuiTaskTask(KeyID); break; case "SubmitCheck_Tb_Task": //提交审核 Result = this.SubmitTask(KeyID); break; case "Complete_Tb_Task": //完成或失败工单 int Flag = int.Parse(Request["Flag"]); Result = this.CompleteTask(KeyID, Flag, Remark); break; default: break; } //将结果输出 Response.Write(Result); Response.End(); } }
//提交数据的代码 void btnSubmit_ServerClick(object sender, EventArgs e) { String error = String.Empty; Control con1 = bean1.CheckControls(out error); //后台进行数据验证 if (con1 != null) { UTools.Alert(error); } else { Dictionary <String, object> dic1 = bean1.GetControlValues(); dic1["ManagerID"] = WebFrame.FrameLib.UserID; dic1["ManagerName"] = WebFrame.FrameLib.UserName; if (String.IsNullOrEmpty(dic1["PlanDate"].ToString())) { dic1["PlanDate"] = DateTime.Parse(dic1["AddTime"].ToString()).AddDays(3).ToString("yyyy-MM-dd"); } dic1["Status"] = "0"; int succ = bean1.SaveDataToDb(dic1); //插入工单日志 Tb_Task_LogBU bu2 = new Tb_Task_LogBU(); bu2.NewLog(this.GuidID.Text, "创建工单", ""); if (succ == 1) //submit succ { String js1 = "layer.alert('操作成功!',function(index){;"; js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);"; js1 = js1 + " parent.$('#butSearch').click();"; js1 = js1 + " parent.layer.close(index);});"; JAjax.ExecuteJS(js1); } else { //throw bean1.MyException; UTools.Alert("操作失败,请重试!"); } } }
void btnSubmit_ServerClick(object sender, EventArgs e) { String error = String.Empty; Control con1 = bean1.CheckControls(out error); //后台进行数据验证 if (con1 != null) { UTools.Alert(error); } else { this.UserName.Text = this.UserID.SelectedItem.Text; Dictionary <String, object> dic1 = bean1.GetControlValues(); //KORWeb.DAL.Tb_KH_ProjectDA da1 = new KORWeb.DAL.Tb_KH_ProjectDA(); //da1.TableName = "Tb_Project_Money"; //dic1.Remove("DataID"); //da1.NewData(dic1); int succ = bean1.SaveDataToDb(dic1); //int succ = 1; if (succ == 1) //submit succ { String js1 = "layer.alert('操作成功!',function(index){;"; js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);"; js1 = js1 + " parent.$('#ctl00_ContentPlaceHolder1_butSearchProject').click();"; js1 = js1 + " parent.layer.close(index);});"; JAjax.ExecuteJS(js1); } else { //throw bean1.MyException; UTools.Alert("操作失败,请重试!"); } } }
//submit data void but1_Click(object sender, EventArgs e) { String error = String.Empty; Control con1 = JControl.CheckControls(new Control[] { this.pass1, this.pass2, this.oldpass }, out error); if (con1 != null) { UTools.AlertAndFocusControl(error, con1.ClientID); } else { JUserBU bu1 = new JUserBU(); error = bu1.ChangeOldPassWord(this.oldpass.Text, this.pass1.Text); if (String.IsNullOrEmpty(error)) { UTools.Alert("提示:密码修改成功,下次登录生效!"); } else { UTools.Alert(error); } } }
private void CalcDamage(EntityBase send, EntityBase recive, int damage, int type) { int curDmg = damage; BattleProps sendProp = send.Props; BattleProps reciveProp = recive.Props; bool critical = false; if (type == 1) // Ad { // 计算闪避 int c = resSev.GetPRD_C(reciveProp.dodge); int p = c * reciveProp.dodgeN; int cur = UTools.RDInt(1, 1000); if (cur <= p) { reciveProp.dodgeN = 1; recive.SetDodge(); return; } else { ++reciveProp.dodgeN; } // 计算属性加成 curDmg += sendProp.ad; // 计算暴击 c = resSev.GetPRD_C(sendProp.critical); p = c * sendProp.criticalN; cur = UTools.RDInt(1, 1000); if (cur <= p) { sendProp.criticalN = 1; curDmg *= 2; critical = true; } else { ++sendProp.criticalN; } // 计算穿甲 int addef = (int)((1f - sendProp.pierce * 1f / 100f) * reciveProp.addef); curDmg -= addef; } else if (type == 2) // AP { // 计算属性加成 curDmg += sendProp.ap; // 计算魔法抗性 curDmg -= reciveProp.apdef; } if (curDmg <= 0) { return; } if (critical) { recive.SetCritical(curDmg); } else { recive.SetDamage(curDmg); } if (recive.Hp < curDmg) { recive.Hp = 0; recive.Die(); recive.BattleMgr.RemoveMonster(recive._gameObject.name); } else { recive.Hp -= curDmg; if (recive.entityState != EntityState.BatiState && recive.GetBreakState()) { recive.Hit(); } } }
public void Execute(IRocketPlayer caller, params string[] command) { try { if (command.Length == 0 || command.Length > 3) { UnturnedChat.Say(caller, "Invalid input. /mute <name> Reason <time>", UnturnedChat.GetColorFromName(UTools.Instance.Configuration.Instance.DutyMsgColor, Color.red)); return; } bool isOnline = false; CSteamID steamid; string charactername = null; string adminId = "Console"; string adminName = "Console"; string reason = ""; int duration = 0; UnturnedPlayer otherPlayer = UnturnedPlayer.FromName(command[0]); ulong? otherPlayerID = command.GetCSteamIDParameter(0); if (otherPlayer == null || otherPlayer.CSteamID.ToString() == "0" || caller != null && otherPlayer.CSteamID.ToString() == caller.Id) { KeyValuePair <CSteamID, string> player = UTools.GetPlayer(command[0]); if (player.Key.ToString() != "0") { steamid = player.Key; charactername = player.Value; } else { if (otherPlayerID != null) { steamid = new CSteamID(otherPlayerID.Value); Profile playerProfile = new Profile(otherPlayerID.Value); charactername = playerProfile.SteamID; } else { UnturnedChat.Say(caller, UTools.Instance.Translate("tpa_player_not_found"), UnturnedChat.GetColorFromName(UTools.Instance.Configuration.Instance.DutyMsgColor, Color.red)); return; } } } else { isOnline = true; steamid = otherPlayer.CSteamID; charactername = otherPlayer.CharacterName; if (otherPlayer.HasPermission("mute.immune")) { UnturnedChat.Say(caller, UTools.Instance.Translate("mute_immune", otherPlayer.CharacterName)); return; } } if (caller != null) { if (caller.ToString() != "Rocket.API.ConsolePlayer") { adminId = caller.ToString(); } adminName = caller.DisplayName; } if (adminId.ToString() == steamid.ToString()) { UnturnedChat.Say(caller, "You cannot mute yourself!", UnturnedChat.GetColorFromName(UTools.Instance.Configuration.Instance.DutyMsgColor, Color.red)); return; } if (UTools.Instance.Database.convertTimeToSeconds(UTools.Instance.Configuration.Instance.DefaultMuteDuration) != 0) { int.TryParse(UTools.Instance.Database.convertTimeToSeconds(UTools.Instance.Configuration.Instance.DefaultMuteDuration).ToString(), out duration); } if (command.Length == 3) { if (int.TryParse(UTools.Instance.Database.convertTimeToSeconds(command[2]).ToString(), out duration)) { reason = command[1]; } else { UnturnedChat.Say(caller, UTools.Instance.Translate("Invalid use! /mute <name> Reason <time>"), UnturnedChat.GetColorFromName(UTools.Instance.Configuration.Instance.DutyMsgColor, Color.red)); return; } } else if (command.Length == 2) { if (UTools.Instance.Database.convertTimeToSeconds(command[1]) > 0) { int.TryParse(UTools.Instance.Database.convertTimeToSeconds(command[1]).ToString(), out duration); } else { reason = command[1]; } } if (UTools.Instance.Database.IsChatBanned(steamid.ToString()) != null) { UnturnedChat.Say(caller, "Player already muted", UnturnedChat.GetColorFromName(UTools.Instance.Configuration.Instance.DutyMsgColor, Color.red)); return; } UTools.Instance.Database.ChatBanPlayer(charactername, steamid.ToString(), adminId, reason, duration); UnturnedChat.Say(UTools.Instance.Translate("mute_public", charactername), UnturnedChat.GetColorFromName(UTools.Instance.Configuration.Instance.DutyMsgColor, Color.red)); UnturnedChat.Say(steamid, UTools.Instance.Translate("mute_private", (duration / 60)), UnturnedChat.GetColorFromName(UTools.Instance.Configuration.Instance.DutyMsgColor, Color.red)); } catch (System.Exception e) { Rocket.Core.Logging.Logger.LogException(e); } }
//提交工单信息 void btnSubmit_ServerClick(object sender, EventArgs e) { int succ = 0; int succ1 = 0; int bugA = 0; int bugB = 0; int bugC = 0; bool checkdata = true; //表示测试未通过,验证数据的合理性 if (this.TestResult.SelectedValue == "0") { int.TryParse(this.BugA.Text, out bugA); int.TryParse(this.BugB.Text, out bugB); int.TryParse(this.BugC.Text, out bugC); if (bugA < 0 || bugB < 0 || bugC < 0 || (bugA + bugB + bugC) <= 0) { checkdata = false; UTools.Alert("提示:测试未通过,请至少输入一个BUG数量!"); } } if (checkdata) { WebFrame.Data.JConnect.GetConnect().BeginTrans(); try { String guidid = Request.QueryString["GuidID"]; Dictionary <string, object> dic1 = new Dictionary <string, object>(); Tb_TaskBU bu1 = new Tb_TaskBU(); //1--更新数据 List <SearchField> condition = new List <SearchField>(); condition.Add(new SearchField("Guidid", guidid)); String result = String.Empty; if (this.TestResult.SelectedValue == "1") { dic1["Status"] = "3"; result = "测试通过"; succ1 = 1; } else { dic1["Status"] = "1"; result = "测试未通过"; } bu1.EditData(condition, dic1); //2--创建日志 String relatefile = String.Empty; String relatruename = String.Empty; Tb_Task_LogBU bu2 = new Tb_Task_LogBU(); succ = bu2.NewLog(guidid, result, this.Remark.Text, "1", this.file1, ref relatefile, ref relatruename); //3--登记Bug记录 if (this.TestResult.SelectedValue == "0") { Tb_Task_BugBU bu3 = new Tb_Task_BugBU(); succ1 = bu3.NewBug(guidid, bugA, bugB, bugC, 0, this.Remark.Text, relatefile, relatruename); } WebFrame.Data.JConnect.GetConnect().CommitTrans(); } catch (Exception err) { WebFrame.Data.JConnect.GetConnect().RollBackTrans(); succ = 0; succ1 = 0; WebFrame.Util.JTool.WriteErrorLog(err.ToString()); } if (succ == 1 && succ1 == 1) //submit succ { String js1 = "layer.alert('操作成功!',function(index){;"; js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);"; js1 = js1 + " parent.$('#butSearch').click();"; js1 = js1 + " parent.layer.close(index);});"; JAjax.ExecuteJS(js1); } else { //throw bean1.MyException; UTools.Alert("操作失败,请重试!"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { String guidid = Request.QueryString["GuidID"]; Tb_TaskBU bu1 = new Tb_TaskBU(); DataRow dr1 = bu1.GetFirstDataRow(guidid, "TaskKind"); int succ = 0; if (dr1 != null) { String taskkind = dr1[0].ToString(); if (taskkind == "1") //处理非开发工单 { WebFrame.Data.JConnect.GetConnect().BeginTrans(); try { Dictionary <string, object> dic1 = new Dictionary <string, object>(); //1--更新数据 List <SearchField> condition = new List <SearchField>(); condition.Add(new SearchField("Guidid", guidid)); String result = String.Empty; dic1["Status"] = "3"; dic1["finishDate"] = DateTime.Now; result = "提交审核"; bu1.EditData(condition, dic1); //2--创建日志 String relatefile = String.Empty; String relatruename = String.Empty; Tb_Task_LogBU bu2 = new Tb_Task_LogBU(); succ = bu2.NewLog(guidid, result, this.Remark.Text, "2", this.file1, ref relatefile, ref relatruename); WebFrame.Data.JConnect.GetConnect().CommitTrans(); } catch (Exception err) { WebFrame.Data.JConnect.GetConnect().RollBackTrans(); } if (succ == 1) //submit succ { String js1 = "layer.alert('操作成功!',function(index){;"; js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);"; js1 = js1 + " parent.$('#butSearch').click();"; js1 = js1 + " parent.layer.close(index);});"; JAjax.ExecuteJS(js1); } else { //throw bean1.MyException; UTools.Alert("操作失败,请重试!"); } } } } }
void btnSubmit_ServerClick(object sender, EventArgs e) { String error = String.Empty; Control con1 = bean1.CheckControls(out error); //后台进行数据验证 if (con1 != null) { UTools.Alert(error); } else { int succ = 0; int succ1 = 0; bool saveFile = false; String FileDir = "/Attachment/UseAttachment/"; String truename1 = String.Empty; WebFrame.Data.JConnect.GetConnect().BeginTrans(); try { Dictionary <String, object> dic1 = bean1.GetControlValues(); dic1["Workload"] = double.Parse(this.Workload.Text); dic1["content"] = (new StringBuilder()).Append(this.content.Text); dic1["contentText"] = (new StringBuilder()).Append(WebFrame.Util.JString.NoHTML(this.content.Text)); if (this.file1.HasFile) { String ext1 = Path.GetExtension(this.file1.FileName); truename1 = WebFrame.Util.JString.GetUnique32ID() + ext1; this.file1.SaveAs(Server.MapPath(FileDir + truename1)); dic1["RelaFile"] = FileDir + truename1; dic1["RelaTrueName"] = Path.GetFileName(this.file1.FileName); saveFile = true; //如果以前有附件,则删除 String s1 = this.data1.Eval("RelaFile"); if (String.IsNullOrEmpty(s1) == false) { s1 = Server.MapPath(s1); if (File.Exists(s1)) { File.Delete(s1); } } } if (String.IsNullOrEmpty(dic1["ExecuteMan"].ToString())) { dic1["Status"] = "0"; succ1 = 1; } else { dic1["Status"] = "1"; //创建日志 } //dic1["Manager"] = WebFrame.FrameLib.UserID; //dic1["AddTime"] = DateTime.Now; //dic1["AddUser"] = WebFrame.FrameLib.UserID; succ = bean1.SaveDataToDb(dic1); //如操作成功,则插入派工单的日志 if (succ == 1 && dic1["Status"].ToString() == "1") { succ1 = (new Tb_Task_LogBU()).NewLog(this.GuidID.Text, "将工单分配给" + dic1["ExecuteMan"].ToString(), "", "0", null); } WebFrame.Data.JConnect.GetConnect().CommitTrans(); } catch (Exception err) { WebFrame.Data.JConnect.GetConnect().RollBackTrans(); succ = 0; } //操作成功 if (succ == 1) //submit succ { String js1 = "layer.msg('操作成功!',{ icon: 1, time: 2000 },function(index){;"; js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);"; js1 = js1 + " parent.$('#butSearch').click();"; js1 = js1 + " parent.layer.close(index);"; //js1 = js1 + String.Format(" location.href='TB_Task_Detail_ADD.aspx?ProjectGuidID={0}';", this.ProjectGuidID.SelectedValue); js1 = js1 + " });"; JAjax.ExecuteJS(js1); } else { if (saveFile && File.Exists(Server.MapPath(FileDir + truename1))) { File.Delete(Server.MapPath(FileDir + truename1)); } UTools.Alert("操作失败,请重试!"); } } }