protected void Submit(object sender, EventArgs e) { Hashtable hashtable = base.Application["hbm"] as Hashtable; string str = string.Concat(hashtable["hibernate.connection.connection_string"]); string str2 = Utils.GetMulti(str, "initial catalog=", ";")[0]; string text = base.Server.MapPath("~/Files"); string text2 = DateTime.Now.ToString("yyMddHHmmss") + ".rar"; string str3 = string.Concat(new string[] { "'", text, "\\", text2, "'" }); string cmdText = "BACKUP DATABASE " + str2 + " TO DISK=" + str3; MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText, null); if (File.Exists(text + "\\" + text2)) { base.Response.Write("<script>window.alert('数据库备份成功!')</script>"); this.l1.Visible = true; this.l1.Text = "<a href='/Files/" + text2 + "' target='_blank'><b>点击下载</b></a>"; } }
protected void ClearIMData(object sender, EventArgs e) { string cmdText = "delete from WM_Message where datediff(d,CreatedTime,getdate())>90"; MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText, null); base.Response.Write("<script>alert('3个月以前的IM数据已成功清理!');window.location='DbBackup.aspx';</script>"); }
private void BackFlow() { FlowsInfo flowsInfo = this.ViewState["Flow"] as FlowsInfo; string str = string.Concat(new string[] { flowsInfo.HasOperatedUserList, this.RealName, "#", this.Uid, "#", this.DepName, "," }); string cmdText = "update Flows set Status=-2,HasOperatedUserList='" + str + "' where status=0 and id=" + base.Request.QueryString["fl"]; MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText, new SqlParameter[0]); string title = "[系统通知] : 您申请的工作流程(" + flowsInfo.Flow_Name + ") 已被退回!"; string content = "您的审批流程 没有被通过!"; int creatorID = flowsInfo.CreatorID; string userlist = string.Concat(new object[] { flowsInfo.CreatorRealName, "#", flowsInfo.CreatorID, "#", flowsInfo.CreatorDepName, "," }); string namelist = flowsInfo.CreatorRealName + "(" + flowsInfo.CreatorDepName + "),"; Help.AdminSendMail(title, content, creatorID, userlist, namelist); }
//protected HtmlForm form1; //protected HtmlGenericControl wdpy; //protected HtmlGenericControl yjpy; //protected HtmlGenericControl wdsq; protected void Page_Load(object sender, EventArgs e) { SqlParameter sqlParameter = new SqlParameter(); sqlParameter.ParameterName = "@uid"; sqlParameter.Size = 50; sqlParameter.Value = this.Uid; SqlParameter sqlParameter2 = new SqlParameter(); sqlParameter2.Direction = ParameterDirection.Output; sqlParameter2.ParameterName = "@pt1"; sqlParameter2.Size = 4; SqlParameter sqlParameter3 = new SqlParameter(); sqlParameter3.Direction = ParameterDirection.Output; sqlParameter3.ParameterName = "@pt2"; sqlParameter3.Size = 4; SqlParameter sqlParameter4 = new SqlParameter(); sqlParameter4.Direction = ParameterDirection.Output; sqlParameter4.ParameterName = "@pt3"; sqlParameter4.Size = 4; SqlParameter[] cmdParms = new SqlParameter[] { sqlParameter2, sqlParameter3, sqlParameter4, sqlParameter }; MsSqlOperate.ExecuteNonQuery(CommandType.StoredProcedure, "Gov_GetRecipientCount", cmdParms); this.wdpy.InnerText = string.Concat(sqlParameter2.Value); this.yjpy.InnerText = string.Concat(sqlParameter3.Value); this.wdsq.InnerText = string.Concat(sqlParameter4.Value); }
protected void Finish_Btn(object sender, EventArgs e) { if (string.Concat(this.ViewState["fm"]) != "0" && this.ViewState["fm"] != null) { string str = "update flows_modelstep set isend=0,ishead=0 where Flow_ModelID=" + this.ViewState["fm"] + ";"; string str2 = "update Flows_Model set iscomplete=1 where id=" + this.ViewState["fm"] + ";"; string str3 = string.Concat(new object[] { "update Flows_ModelStep set isend=1 where Flow_ModelID=", this.ViewState["fm"], " and id = (select max(id) from Flows_ModelStep where Flow_ModelID=", this.ViewState["fm"], ");" }); string str4 = string.Concat(new object[] { "update Flows_ModelStep set ishead=1 where Flow_ModelID=", this.ViewState["fm"], " and id = (select min(id) from Flows_ModelStep where Flow_ModelID=", this.ViewState["fm"], ");" }); MsSqlOperate.ExecuteNonQuery(CommandType.Text, str + str2 + str3 + str4, new SqlParameter[0]); string str5 = HttpContext.Current.Server.HtmlEncode("您好!模型工作流程设计完成!"); base.Response.Redirect("~/InfoTip/Operate_Success.aspx?returnpage=../Manage/flow/Flow_ModelList.aspx&tip=" + str5); } }
private void FinishFlow() { GovInfo govInfo = this.ViewState["Flow"] as GovInfo; string str = string.Concat(new string[] { govInfo.HasOperatedUserList, this.RealName, "#", this.Uid, "#", this.DepName, "," }); string cmdText = "update Gov set Status=1,HasOperatedUserList='" + str + "' where status=0 and id=" + base.Request.QueryString["fl"]; MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText, new SqlParameter[0]); string title = "[系统通知] : 您拟稿的公文(" + govInfo.Flow_Name + ") 已通过审批正式签发!"; string content = "恭喜您! 公文通过所有审核审批步骤 已成功签发!"; int creatorID = govInfo.CreatorID; string userlist = string.Concat(new object[] { govInfo.CreatorRealName, "#", govInfo.CreatorID, "#", govInfo.CreatorDepName, "," }); string namelist = govInfo.CreatorRealName + "(" + govInfo.CreatorDepName + "),"; Help.AdminSendMail(title, content, creatorID, userlist, namelist); }
protected void Del_Btn(object obj, EventArgs e) { LinkButton linkButton = obj as LinkButton; RepeaterItem repeaterItem = linkButton.Parent as RepeaterItem; HtmlInputCheckBox htmlInputCheckBox = repeaterItem.FindControl("chk") as HtmlInputCheckBox; int num = Convert.ToInt32(htmlInputCheckBox.Value); try { IList all = Docs_Doc.Init().GetAll("doctypeid=" + num, null); if (all != null && all.Count > 0) { foreach (object current in all) { Docs_DocInfo docs_DocInfo = current as Docs_DocInfo; Help.DeleteFiles(docs_DocInfo.FilePath); } } } catch { } string cmdText = "delete from Docs_Doc where doctypeid=" + num; MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText, new SqlParameter[0]); Docs_DocType.Init().Delete(num); this.Show(); }
private void Show() { SqlParameter sqlParameter = new SqlParameter(); sqlParameter.ParameterName = "@uid"; sqlParameter.Size = 50; sqlParameter.Value = this.Uid; SqlParameter sqlParameter2 = new SqlParameter(); sqlParameter2.Direction = ParameterDirection.Output; sqlParameter2.ParameterName = "@pt1"; sqlParameter2.Size = 4; SqlParameter sqlParameter3 = new SqlParameter(); sqlParameter3.Direction = ParameterDirection.Output; sqlParameter3.ParameterName = "@pt2"; sqlParameter3.Size = 4; SqlParameter sqlParameter4 = new SqlParameter(); sqlParameter4.Direction = ParameterDirection.Output; sqlParameter4.ParameterName = "@pt3"; sqlParameter4.Size = 4; SqlParameter sqlParameter5 = new SqlParameter(); sqlParameter5.Direction = ParameterDirection.Output; sqlParameter5.ParameterName = "@pt4"; sqlParameter5.Size = 4; SqlParameter[] cmdParms = new SqlParameter[] { sqlParameter2, sqlParameter3, sqlParameter4, sqlParameter5, sqlParameter }; MsSqlOperate.ExecuteNonQuery(CommandType.StoredProcedure, "Flows_GetUserFlowBoxCount", cmdParms); this.wdpy.InnerText = string.Concat(sqlParameter2.Value); this.yjpy.InnerText = string.Concat(sqlParameter3.Value); this.wdsq.InnerText = string.Concat(sqlParameter4.Value); this.view.InnerText = string.Concat(sqlParameter5.Value); IList all = Flows_Model.Init().GetAll("IsComplete=1 and ( ShareDeps='' or ShareDeps like '%#" + this.DepID + "#%') ", null); this.ModelFlowList.Items.Add(new ListItem("== 请从以下列表 选择一个流程类型", "")); int i; for (i = 0; i < all.Count; i++) { Flows_ModelInfo flows_ModelInfo = all[i] as Flows_ModelInfo; this.ModelFlowList.Items.Add(new ListItem(flows_ModelInfo.Flow_Name, flows_ModelInfo.id + "," + flows_ModelInfo.ModelFileID)); } this.GetFirtNode(); this.Model_Type.Items.Add(new ListItem("== 请选择一个分类", "-1")); i = 0; int count = this.li.Count; while (i < count) { Flows_Model_TypeInfo flows_Model_TypeInfo = this.li[i]; this.Model_Type.Items.Add(new ListItem(flows_Model_TypeInfo.Sh, string.Concat(flows_Model_TypeInfo.id))); i++; } this.Model_Type.Items.Add(new ListItem("不属于任何分类", "0")); }
protected void Cancer_Btn(object sender, EventArgs e) { if (string.Concat(this.ViewState["fm"]) != "0" && this.ViewState["fm"] != null) { string cmdText = "delete from Flows_Model where id=" + this.ViewState["fm"]; string cmdText2 = "delete from Flows_ModelStep where Flow_ModelID=" + this.ViewState["fm"]; MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText, new SqlParameter[0]); MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText2, new SqlParameter[0]); } base.Response.Redirect("Flow_ModelList.aspx"); }
protected void Del_Btn(object obj, EventArgs e) { LinkButton linkButton = obj as LinkButton; RepeaterItem repeaterItem = linkButton.Parent as RepeaterItem; HtmlInputCheckBox htmlInputCheckBox = repeaterItem.FindControl("chk") as HtmlInputCheckBox; int num = Convert.ToInt32(htmlInputCheckBox.Value); string cmdText = "delete from Sys_Role_Module where RoleID=" + num; MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText, null); Sys_Role.Init().Delete(num); this.Show(); }
protected void MoveToLJ(object sender, EventArgs e) { string value = base.Request.QueryString["mid"]; if (!string.IsNullOrEmpty(value)) { string cmdText = "update mails set foldertype=3 where id=" + Convert.ToInt32(value); MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText, new SqlParameter[0]); string str = HttpContext.Current.Server.HtmlEncode("您好!邮件已删除至垃圾箱!"); base.Response.Redirect("~/InfoTip/Operate_Success.aspx?returnpage=" + base.Request.Url.AbsoluteUri + "&tip=" + str); } }
protected void Del_Mail(object sender, EventArgs e) { string value = base.Request.QueryString["mid"]; if (!string.IsNullOrEmpty(value)) { string cmdText = "delete from mails where id=" + Convert.ToInt32(value); MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText, new SqlParameter[0]); string str = HttpContext.Current.Server.HtmlEncode("您好!邮件已彻底删除!"); base.Response.Redirect("~/InfoTip/Operate_Success.aspx?returnpage=../Manage/Common/Mail_List.aspx?fid=0&tip=" + str); } }
protected void Del_Btn(object obj, EventArgs e) { LinkButton linkButton = obj as LinkButton; RepeaterItem repeaterItem = linkButton.Parent as RepeaterItem; HtmlInputCheckBox htmlInputCheckBox = repeaterItem.FindControl("chk") as HtmlInputCheckBox; int num = Convert.ToInt32(htmlInputCheckBox.Value); string cmdText = "delete from Flows_Model where id=" + num; string cmdText2 = "delete from Flows_ModelStep where Flow_ModelID=" + num; MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText, new SqlParameter[0]); MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText2, new SqlParameter[0]); this.Show(); }
private void DeleteDep(Flows_Model_TypeInfo sdi) { IList all = Flows_Model_Type.Init().GetAll("ParentID=" + sdi.id, null); for (int i = 0; i < all.Count; i++) { Flows_Model_TypeInfo sdi2 = all[i] as Flows_Model_TypeInfo; this.DeleteDep(sdi2); } string cmdText = "delete from Flows_Model where comid=" + sdi.id; MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText, new SqlParameter[0]); Flows_Model_Type.Init().Delete(sdi.id); }
protected void Del_Btn(object obj, EventArgs e) { LinkButton linkButton = obj as LinkButton; RepeaterItem repeaterItem = linkButton.Parent.Parent as RepeaterItem; HtmlInputCheckBox htmlInputCheckBox = repeaterItem.FindControl("chk") as HtmlInputCheckBox; int num = Convert.ToInt32(htmlInputCheckBox.Value); CRMInfo byId = CRM.Init().GetById(num); Help.DeleteFiles(byId.FilePath); string cmdText = "delete from CRM_Contact where cid=" + num; MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText, new SqlParameter[0]); CRM.Init().Delete(num); this.Show(); }
protected void Del_All(object sender, EventArgs e) { foreach (RepeaterItem repeaterItem in this.rpt.Items) { HtmlInputCheckBox htmlInputCheckBox = repeaterItem.FindControl("chk") as HtmlInputCheckBox; if (htmlInputCheckBox.Checked) { int num = Convert.ToInt32(htmlInputCheckBox.Value); Flows_ModelFile.Init().Delete(num); string cmdText = "update Flows_Model set ModelFileID='0' where ModelFileID='" + num + "'"; MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText, null); } } this.Show(); }
protected void Del_All(object sender, EventArgs e) { foreach (RepeaterItem repeaterItem in this.rpt.Items) { HtmlInputCheckBox htmlInputCheckBox = repeaterItem.FindControl("chk") as HtmlInputCheckBox; if (htmlInputCheckBox.Checked) { int num = Convert.ToInt32(htmlInputCheckBox.Value); string cmdText = "delete from Flows_Model where id=" + num; string cmdText2 = "delete from Flows_ModelStep where Flow_ModelID=" + num; MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText, new SqlParameter[0]); MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText2, new SqlParameter[0]); } } this.Show(); }
protected void Del_Btn(object obj, EventArgs e) { LinkButton linkButton = obj as LinkButton; RepeaterItem repeaterItem = linkButton.Parent.Parent as RepeaterItem; Panel panel = repeaterItem.FindControl("d") as Panel; if (panel.Visible) { HtmlInputCheckBox htmlInputCheckBox = repeaterItem.FindControl("chk") as HtmlInputCheckBox; int num = Convert.ToInt32(htmlInputCheckBox.Value); string cmdText = "delete from VoteDetail where VoteID=" + num; MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText, new SqlParameter[0]); Vote.Init().Delete(num); base.Response.Redirect("Vote_AllList.aspx"); } }
//protected HtmlForm form1; //protected HtmlGenericControl sjx; //protected HtmlGenericControl cgx; //protected HtmlGenericControl fjx; //protected HtmlGenericControl ljx; protected void Page_Load(object sender, EventArgs e) { SqlParameter sqlParameter = new SqlParameter(); sqlParameter.ParameterName = "@uid"; sqlParameter.Size = 4; sqlParameter.Value = Convert.ToInt32(this.Uid); SqlParameter sqlParameter2 = new SqlParameter(); sqlParameter2.Direction = ParameterDirection.Output; sqlParameter2.ParameterName = "@pt0"; sqlParameter2.Size = 4; SqlParameter sqlParameter3 = new SqlParameter(); sqlParameter3.Direction = ParameterDirection.Output; sqlParameter3.ParameterName = "@pt1"; sqlParameter3.Size = 4; SqlParameter sqlParameter4 = new SqlParameter(); sqlParameter4.Direction = ParameterDirection.Output; sqlParameter4.ParameterName = "@pt2"; sqlParameter4.Size = 4; SqlParameter sqlParameter5 = new SqlParameter(); sqlParameter5.Direction = ParameterDirection.Output; sqlParameter5.ParameterName = "@pt3"; sqlParameter5.Size = 4; SqlParameter sqlParameter6 = new SqlParameter(); sqlParameter6.Direction = ParameterDirection.Output; sqlParameter6.ParameterName = "@pt4"; sqlParameter6.Size = 4; SqlParameter[] cmdParms = new SqlParameter[] { sqlParameter2, sqlParameter3, sqlParameter4, sqlParameter5, sqlParameter6, sqlParameter }; MsSqlOperate.ExecuteNonQuery(CommandType.StoredProcedure, "Mails_GetAllMailBoxCount", cmdParms); this.sjx.InnerText = sqlParameter2.Value + "/" + sqlParameter6.Value; this.cgx.InnerText = string.Concat(sqlParameter3.Value); this.fjx.InnerText = string.Concat(sqlParameter4.Value); this.ljx.InnerText = string.Concat(sqlParameter5.Value); }
protected void Save_Btn(object sender, EventArgs e) { if (this.ViewState["gi"] != null) { Gov_RecipientInfo gov_RecipientInfo = this.ViewState["gi"] as Gov_RecipientInfo; if (gov_RecipientInfo.Sign == 0) { gov_RecipientInfo.FeedBack = base.Request.Form["FeedBack"]; gov_RecipientInfo.Sign = 1; gov_RecipientInfo.SignTime = DateTime.Now; Gov_Recipient.Init().Update(gov_RecipientInfo); string format = "update gov set status=5 where id={0} and status=1 and IsValid=0 and (select count(*) from Gov_Recipient where flow_id={0} and sign=0)=0"; MsSqlOperate.ExecuteNonQuery(CommandType.Text, string.Format(format, gov_RecipientInfo.Flow_ID), new SqlParameter[0]); MessageBox.ShowAndRedirect(this, "公文已成功签收!", "RecMenu.aspx"); } } }
protected void Del(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; RepeaterItem repeaterItem = linkButton.Parent as RepeaterItem; HtmlInputCheckBox htmlInputCheckBox = repeaterItem.FindControl("chk") as HtmlInputCheckBox; string value = htmlInputCheckBox.Value; try { int num = Convert.ToInt32(value); GovInfo byId = Gov.Init().GetById(num); if (byId != null) { Help.DeleteFiles(byId.Flow_Files); Help.DeleteFiles(byId.CurrentDocPath); } IList all = Gov_Doc.Init().GetAll("flow_id=" + num, null); if (all != null && all.Count > 0) { foreach (object current in all) { Gov_DocInfo gov_DocInfo = current as Gov_DocInfo; Help.DeleteFiles(gov_DocInfo.DocPath); } } } catch { } string text = "delete from Gov where id=" + value + ";"; string text2 = "delete from Gov_Step where Flow_ID=" + value + ";"; string text3 = "delete from Gov_StepAction where FlowID=" + value + ";"; string text4 = "delete from Gov_Doc where Flow_ID=" + value + ";"; string text5 = "delete from Gov_Recipient where Flow_ID=" + value + ";"; MsSqlOperate.ExecuteNonQuery(CommandType.Text, string.Concat(new string[] { text, text2, text3, text4, text5 }), new SqlParameter[0]); this.Show(); }
protected void MoveToLJ(object sender, EventArgs e) { if (base.Request.QueryString["fid"] != "3") { foreach (RepeaterItem repeaterItem in this.rpt.Items) { HtmlInputCheckBox htmlInputCheckBox = repeaterItem.FindControl("chk") as HtmlInputCheckBox; if (htmlInputCheckBox.Checked) { int num = Convert.ToInt32(htmlInputCheckBox.Value); string cmdText = "update mails set FolderType=3 where id=" + num; MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText, new SqlParameter[0]); } } string str = HttpContext.Current.Server.HtmlEncode("您好!邮件已删除至垃圾箱!"); base.Response.Redirect("~/InfoTip/Operate_Success.aspx?returnpage=" + base.Request.Url.AbsoluteUri + "&tip=" + str); } }
protected void SaveStep_Btn(object sender, EventArgs e) { string cmdText = "update Flows_Model set IsComplete=0 where id=" + this.ViewState["fm"]; MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText, new SqlParameter[0]); if (this.ModelName.Visible) { this.ModelName.Visible = true; this.ModelStep.Visible = false; this.SaveModelFlow(); } else { this.SaveSetpFlow(); } this.save1.Enabled = true; this.add1.Enabled = true; this.BindRpt(string.Concat(this.ViewState["fm"])); }
private void Show() { SqlParameter sqlParameter = new SqlParameter(); sqlParameter.ParameterName = "@uid"; sqlParameter.Size = 50; sqlParameter.Value = this.Uid; SqlParameter sqlParameter2 = new SqlParameter(); sqlParameter2.Direction = ParameterDirection.Output; sqlParameter2.ParameterName = "@pt1"; sqlParameter2.Size = 4; SqlParameter sqlParameter3 = new SqlParameter(); sqlParameter3.Direction = ParameterDirection.Output; sqlParameter3.ParameterName = "@pt2"; sqlParameter3.Size = 4; SqlParameter sqlParameter4 = new SqlParameter(); sqlParameter4.Direction = ParameterDirection.Output; sqlParameter4.ParameterName = "@pt3"; sqlParameter4.Size = 4; SqlParameter sqlParameter5 = new SqlParameter(); sqlParameter5.Direction = ParameterDirection.Output; sqlParameter5.ParameterName = "@pt4"; sqlParameter5.Size = 4; SqlParameter[] cmdParms = new SqlParameter[] { sqlParameter2, sqlParameter3, sqlParameter4, sqlParameter5, sqlParameter }; MsSqlOperate.ExecuteNonQuery(CommandType.StoredProcedure, "Flows_GetUserFlowBoxCount", cmdParms); this.wdpy.InnerText = string.Concat(sqlParameter2.Value); this.yjpy.InnerText = string.Concat(sqlParameter3.Value); this.wdsq.InnerText = string.Concat(sqlParameter4.Value); this.view.InnerText = string.Concat(sqlParameter5.Value); this.GetFirtNode(); this.rpt.DataSource = this.li; this.rpt.DataBind(); }
//protected HtmlForm form1; //protected HtmlGenericControl t_all; //protected HtmlGenericControl t_exeute; //protected HtmlGenericControl t_manage; //protected HtmlGenericControl t_create; protected void Page_Load(object sender, EventArgs e) { SqlParameter sqlParameter = new SqlParameter(); sqlParameter.ParameterName = "@uid"; sqlParameter.Size = 50; sqlParameter.Value = this.Uid; SqlParameter sqlParameter2 = new SqlParameter(); sqlParameter2.Direction = ParameterDirection.Output; sqlParameter2.ParameterName = "@pt0"; sqlParameter2.Size = 4; SqlParameter sqlParameter3 = new SqlParameter(); sqlParameter3.Direction = ParameterDirection.Output; sqlParameter3.ParameterName = "@pt1"; sqlParameter3.Size = 4; SqlParameter sqlParameter4 = new SqlParameter(); sqlParameter4.Direction = ParameterDirection.Output; sqlParameter4.ParameterName = "@pt2"; sqlParameter4.Size = 4; SqlParameter sqlParameter5 = new SqlParameter(); sqlParameter5.Direction = ParameterDirection.Output; sqlParameter5.ParameterName = "@pt3"; sqlParameter5.Size = 4; SqlParameter[] cmdParms = new SqlParameter[] { sqlParameter2, sqlParameter3, sqlParameter4, sqlParameter5, sqlParameter }; MsSqlOperate.ExecuteNonQuery(CommandType.StoredProcedure, "Tasks_GetTaskCount", cmdParms); this.t_all.InnerText = string.Concat(sqlParameter2.Value); this.t_exeute.InnerText = string.Concat(sqlParameter3.Value); this.t_manage.InnerText = string.Concat(sqlParameter4.Value); this.t_create.InnerText = string.Concat(sqlParameter5.Value); }
private void DeletePaper(int rid) { try { IList all = Paper.Init().GetAll("TypeID=" + rid, null); if (all != null && all.Count > 0) { foreach (object current in all) { PaperInfo paperInfo = current as PaperInfo; Help.DeleteFiles(paperInfo.FilePath); } } } catch { } string cmdText = "delete from Paper where typeid=" + rid; MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText, new SqlParameter[0]); }
public string Update <T>(T entity, Action <T> update) where T : class { string result; try { update(entity); string cmdText = "update Calendar set UID=@UID,EID=@EID,EName=@EName,STime=@STime,ETime=@ETime,CTime=@CTime,MEMO=@MEMO,MTime=@MTime,LogicDelete=@LogicDelete where ID=@ID"; Calendars calendars = entity as Calendars; SqlParameter[] cmdParms = new SqlParameter[] { new SqlParameter("@UID", calendars.UID), new SqlParameter("@EID", calendars.EID), new SqlParameter("@EName", calendars.EName), new SqlParameter("@STime", calendars.STime), new SqlParameter("@ETime", calendars.ETime), new SqlParameter("@CTime", calendars.CTime), new SqlParameter("@MEMO", calendars.MEMO), new SqlParameter("@MTime", calendars.MTime), new SqlParameter("@LogicDelete", calendars.LogicDelete), new SqlParameter("@ID", calendars.ID) }; int num = MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText, cmdParms); if (num > 0) { result = "1"; } else { result = "0"; } } catch { result = "0"; } return(result); }
protected void Del_Btn(object obj, EventArgs e) { LinkButton linkButton = obj as LinkButton; RepeaterItem repeaterItem = linkButton.Parent as RepeaterItem; HtmlInputCheckBox htmlInputCheckBox = repeaterItem.FindControl("chk") as HtmlInputCheckBox; int id = Convert.ToInt32(htmlInputCheckBox.Value); TasksInfo byId = Tasks.Init().GetById(id); IList all = Tasks_User.Init().GetAll("TaskID=" + byId.id, null); if (all.Count > 0) { int i = 0; int count = all.Count; while (i < count) { Tasks_UserInfo tasks_UserInfo = all[i] as Tasks_UserInfo; try { Help.DeleteFiles(tasks_UserInfo.FilePath); } catch { } i++; } string cmdText = "delete from Tasks_User where TaskID=" + byId.id; MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText, new SqlParameter[0]); } try { Help.DeleteFiles(byId.FilePath); } catch { } Tasks.Init().Delete(id); this.Show(base.Request.QueryString["type"]); }
private void DelUserDetail(string u) { string text = "delete from Calendar where uid='" + u + "';"; string text2 = "delete from Docs_Office where CreatorID=" + u + ";"; string text3 = "delete from NoteBook where UserID=" + u + ";"; string text4 = "delete from PhoneBook where UserID=" + u + ";"; string text5 = "delete from Mails where ReceiverID=" + u + ";"; string text6 = "delete from Docs_Doc where CreatorID=" + u + ";"; string text7 = "delete from Docs_DocType where Uid=" + u + ";"; MsSqlOperate.ExecuteNonQuery(CommandType.Text, string.Concat(new string[] { text, text2, text3, text4, text5, text6, text7 }), new SqlParameter[0]); List <Sys_UserInfo> list = base.Application["user_online"] as List <Sys_UserInfo>; list.Find(delegate(Sys_UserInfo s) { bool result; if (s.id.ToString() == u) { s.IsOnline = 9; result = true; } else { result = false; } return(result); }); }
protected void Lock(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; RepeaterItem repeaterItem = linkButton.Parent as RepeaterItem; HtmlInputCheckBox htmlInputCheckBox = repeaterItem.FindControl("chk") as HtmlInputCheckBox; string value = htmlInputCheckBox.Value; string commandArgument = linkButton.CommandArgument; if (commandArgument == "-1" || commandArgument == "0") { string str = ""; if (commandArgument == "-1") { str = "0"; } if (commandArgument == "0") { str = "-1"; } string cmdText = "update Gov set status=" + str + " where id=" + value; MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText, new SqlParameter[0]); } this.Show(); }