//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 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 static void BBS_Login(string u, string p) { string text = p.Substring(8, 16).ToLower(); HttpCookie httpCookie = new HttpCookie("DXBBS"); httpCookie["UserName"] = Filter.Encode(u, ForumConfig.ReadConfigInfo().SecureKey); httpCookie["UserPass"] = Filter.Encode(text, ForumConfig.ReadConfigInfo().SecureKey); httpCookie["Key"] = Filter.Encode(Clients.CookiesKey, ForumConfig.ReadConfigInfo().SecureKey); httpCookie.Expires = DateTime.Now.AddDays((double)2); httpCookie["IsHide"] = "false"; HttpContext.Current.Response.Cookies.Add(httpCookie); string cmdText = "select a.*,b.LevelName from WC_Forum_User a,WC_Forum_Level b where username=@u and a.LevelID=b.id"; DataSet dataSet = MsSqlOperate.ExecuteDataset(CommandType.Text, cmdText, new SqlParameter[] { new SqlParameter("@u", u) }); int num = 0; int.TryParse(dataSet.Tables[0].Rows[0]["ID"].ToString(), out num); if (num > 0) { Sessions.UserID = num; Sessions.UserName = u; Sessions.LevelID = Convert.ToInt32(dataSet.Tables[0].Rows[0]["LevelID"]); Sessions.LevelName = string.Concat(dataSet.Tables[0].Rows[0]["LevelName"]); } dataSet.Dispose(); }
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 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(); }
public List <Calendars> Find_Calendar_ByPara_list(string uid, string eid) { string text = "select * from Calendar where {0}"; string arg = string.Concat(new string[] { " LogicDelete=0 and Uid='", uid, "' and Eid='", eid, "' " }); text = string.Format(text, arg); List <Calendars> result; using (DataSet dataSet = MsSqlOperate.ExecuteDataset(CommandType.Text, text, new SqlParameter[0])) { if (dataSet.Tables[0].Rows.Count > 0) { List <Calendars> list = new List <Calendars>(); for (int i = 0; i < dataSet.Tables[0].Rows.Count; i++) { list.Add(this.SetPram(dataSet.Tables[0].Rows[i])); } result = list; } else { result = null; } } return(result); }
public Calendars Find_Calendar_ByPara(string uid, string eid) { string text = "select * from Calendar where {0}"; string arg = string.Concat(new string[] { " LogicDelete=0 and Uid='", uid, "' and Eid='", eid, "' " }); text = string.Format(text, arg); Calendars result; using (DataSet dataSet = MsSqlOperate.ExecuteDataset(CommandType.Text, text, new SqlParameter[0])) { if (dataSet.Tables[0].Rows.Count > 0) { result = this.SetPram(dataSet.Tables[0].Rows[0]); } else { result = null; } } return(result); }
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); }
private void Show(string cid) { Hashtable hashtable = (Hashtable)HttpContext.Current.Application["config_fenye"]; int num = Convert.ToInt32(hashtable["fenye_commom"]); int num2 = 0; try { if (!string.IsNullOrEmpty(base.Request.QueryString["page"])) { num2 = Convert.ToInt32(base.Request.QueryString["page"]); } } catch { } if (num2 == 0) { num2 = 1; } int num3 = num * (num2 - 1); string text = string.Concat(new string[] { " cid=", cid, " and CreatorID=", this.Uid, " " }); int num4 = Convert.ToInt32(MsSqlOperate.ExecuteScalar(CommandType.Text, "select count(*) from CRM_Contact where " + text, null)); this.num.InnerHtml = "当前查询条件总计 - <span style='color:#ff0000; font-weight:bold;'>" + num4 + "</span> 条 记录数据"; string sql = string.Concat(new object[] { "select top ", num, " * from CRM_Contact where ", text, " order by id desc" }); if (num2 != 1) { sql = string.Concat(new object[] { "SELECT TOP ", num, " * FROM CRM_Contact WHERE id<(SELECT MIN(id) FROM (SELECT TOP ", num3.ToString(), " id FROM CRM_Contact WHERE (", text, " ) ORDER BY id DESC) T1) AND (", text, " ) ORDER BY id DESC" }); } this.Bind(sql, this.rpt); this.Page1.sty("meneame", num2, this.GetCountPage(num4, num), "?cid=" + cid + "&page="); }
private IList GetOrdersUser() { object value = MsSqlOperate.ExecuteScalar(CommandType.Text, "select min(id) from sys_dep where ParentID=0", new SqlParameter[0]); List <Sys_UserInfo> list = new List <Sys_UserInfo>(); this.GetTreeItems(Convert.ToInt32(value), list); return(list); }
private void Bind(string sql, Repeater r) { using (DataSet dataSet = MsSqlOperate.ExecuteDataset(CommandType.Text, sql, null)) { r.DataSource = dataSet.Tables[0].DefaultView; r.DataBind(); } }
private string GetVoteItemCount(string name, int vid) { string cmdText = "select count(*) from VoteDetail where VoteID=" + vid + " and ItemName=@ItemName"; return(string.Concat(MsSqlOperate.ExecuteScalar(CommandType.Text, cmdText, new SqlParameter[] { new SqlParameter("@ItemName", name ?? "") }))); }
private void Show() { Hashtable hashtable = (Hashtable)HttpContext.Current.Application["config_fenye"]; //int pageSize = Convert.ToInt32(hashtable["fenye_commom"]); int pageSize = 20; int num = 0; try { if (!string.IsNullOrEmpty(base.Request.QueryString["page"])) { num = Convert.ToInt32(base.Request.QueryString["page"]); } } catch { } if (num == 0) { num = 1; } PagedDataSource pagedDataSource = new PagedDataSource(); string text = " a.TypeID = b.id "; string text2 = base.Request.QueryString["keywords"]; if (!string.IsNullOrEmpty(text2) && Utils.CheckSql(text2)) { text = " a.TypeID = b.id "; text = text + " and (a.NewsTitle like '%" + text2 + "%' ) "; } if (!string.IsNullOrEmpty(base.Request.QueryString["tid"])) { string str = base.Request.QueryString["tid"]; text = " a.TypeID=" + str + " and a.TypeID = b.id "; } string cmdText = "select a.*,b.TypeName from News_Article as a,News_Type as b where " + text + " order by a.id desc"; using (DataSet dataSet = MsSqlOperate.ExecuteDataset(CommandType.Text, cmdText, new SqlParameter[0])) { this.num.InnerHtml = "当前查询条件总计 - <span style='color:#ff0000; font-weight:bold;'>" + dataSet.Tables[0].Rows.Count + "</span> 条 记录数据"; pagedDataSource.DataSource = dataSet.Tables[0].DefaultView; pagedDataSource.AllowPaging = true; pagedDataSource.PageSize = pageSize; pagedDataSource.CurrentPageIndex = num - 1; this.rpt.DataSource = pagedDataSource; this.rpt.DataBind(); if (!string.IsNullOrEmpty(base.Request.QueryString["keywords"])) { this.Page2.sty("meneame", num, pagedDataSource.PageCount, "?keywords=" + text2 + "&page="); } if (!string.IsNullOrEmpty(base.Request.QueryString["tid"])) { this.Page2.sty("meneame", num, pagedDataSource.PageCount, "?tid=" + base.Request.QueryString["tid"] + "&page="); } this.Page2.sty("meneame", num, pagedDataSource.PageCount, "?page="); } }
private static void UpdateDeps() { int a_ = 7; if (true) { } //HttpContext.Current.Application[Module.a("쒰잲솴", a_)] = string.Concat(MsSqlOperate.ExecuteScalar(CommandType.Text, Admin_Help.UpdateFlows(), new SqlParameter[0])); HttpContext.Current.Application["uut"] = string.Concat(MsSqlOperate.ExecuteScalar(CommandType.Text, Admin_Help.UpdateFlows(), new SqlParameter[0])); }
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")); }
//public static void UpdateIMUser(Sys_UserInfo ui) //{ // try // { // string cmdText = "select [Key] from WM_Users where Name='" + ui.UserName + "'"; // string text = string.Concat(MsSqlOperate.ExecuteScalar(CommandType.Text, cmdText, new SqlParameter[0])); // if (Utils.IsNumber(text)) // { // string str = string.Concat(new string[] // { // "update WM_Users set Nickname='", // ui.RealName, // "',Password='******',EMail='", // ui.Email, // "',Phone='", // ui.Phone, // "',TelPhone='", // ui.Tel, // "' where Name='", // ui.UserName, // "';" // }); // string text2 = string.Format("DELETE FROM WM_UDD WHERE uid={1} ; INSERT INTO WM_UDD(did,uid,tid)VALUES({0},{1},0) ", ui.DepID, text); // text2 = str + text2; // MsSqlOperate.ExecuteNonQuery(CommandType.Text, text2, new SqlParameter[0]); // AccountImpl.Instance._RefreshUserInfo(Convert.ToInt64(text)); // } // else // { // AccountImpl.Instance.AddUser(ui.UserName, ui.RealName, ui.PassWord, ui.Email, ui.Phone, ui.Tel); // string cmdText2 = "select [Key] from WM_Users where Name='" + ui.UserName + "'"; // string text3 = string.Concat(MsSqlOperate.ExecuteScalar(CommandType.Text, cmdText2, new SqlParameter[0])); // if (Utils.IsNumber(text3)) // { // string text2 = string.Format("DELETE FROM WM_UDD WHERE uid={1} ; INSERT INTO WM_UDD(did,uid,tid)VALUES({0},{1},0) ", ui.DepID, text3); // MsSqlOperate.ExecuteNonQuery(CommandType.Text, text2, new SqlParameter[0]); // } // } // } // catch (Exception ex) // { // throw ex; // } //} public static void UpdateIMUser(Sys_UserInfo ui) { try { string cmdText = "select ID from Users where Name='" + ui.UserName + "'"; string text = string.Concat(MsSqlOperate.ExecuteScalar(CommandType.Text, cmdText, new SqlParameter[0])); if (Utils.IsNumber(text)) { string str = string.Concat(new string[] { "update Users set Nickname='", ui.RealName, "',Password='******',EMail='", ui.Email, "',Tel='", ui.Phone, "',Mobile='", ui.Tel, "' where Name='", ui.UserName, "';" }); //MsSqlOperate.ExecuteNonQuery(CommandType.Text, str, new SqlParameter[0]); } else { int id = AccountImpl.Instance.CreateUser( ui.UserName.ToString(), ui.RealName.ToString(), ui.PassWord.ToString(), ui.Email.ToString(), -1, 0 ); AccountInfo newUser = AccountImpl.Instance.GetUserInfo(id); //AccountImpl.Instance.AddUser(ui.UserName, ui.RealName, ui.PassWord, ui.Email, ui.Phone, ui.Tel); string cmdText2 = "select ID from Users where Name='" + ui.UserName + "'"; string text3 = string.Concat(MsSqlOperate.ExecuteScalar(CommandType.Text, cmdText2, new SqlParameter[0])); if (Utils.IsNumber(text3)) { string text2 = string.Format("DELETE FROM WM_UDD WHERE uid={1} ; INSERT INTO WM_UDD(did,uid,tid)VALUES({0},{1},0) ", ui.DepID, text3); //MsSqlOperate.ExecuteNonQuery(CommandType.Text, text2, new SqlParameter[0]); } } } catch (Exception ex) { throw ex; } }
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_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 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_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(); }
public List <Calendars> Find_Calendar_List_ByUID_and_TIME(string[] uid, string[] stime, string[] etime, int startIndex, int pageNum) { string text = " "; for (int i = 0; i < uid.Length; i++) { if (i != uid.Length - 1) { string text2 = text; text = string.Concat(new string[] { text2, " ( logicdelete= 0 and UID = '", uid[i].ToString(), "' and STime > '", stime[i].ToString(), "' and STime <= '", etime[i].ToString(), "') or " }); } else { string text2 = text; text = string.Concat(new string[] { text2, " ( logicdelete= 0 and UID = '", uid[i].ToString(), "' and STime > '", stime[i].ToString(), "' and STime <= '", etime[i].ToString(), "') " }); } } string text3 = "select * from Calendar where {0}"; text3 = string.Format(text3, text); List <Calendars> result; using (DataSet dataSet = MsSqlOperate.ExecuteDataset(CommandType.Text, text3, new SqlParameter[0])) { List <Calendars> list = new List <Calendars>(); for (int i = 0; i < dataSet.Tables[0].Rows.Count; i++) { list.Add(this.SetPram(dataSet.Tables[0].Rows[i])); } result = list; } 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 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 Show() { int num = 50; int num2 = 0; try { if (!string.IsNullOrEmpty(base.Request.QueryString["page"])) { num2 = Convert.ToInt32(base.Request.QueryString["page"]); } } catch { } if (num2 == 0) { num2 = 1; } string text = " UserName='******'"; int num3 = num * (num2 - 1); int num4 = Convert.ToInt32(MsSqlOperate.ExecuteScalar(CommandType.Text, "select count(*) from Sys_UserLogin where " + text, null)); this.num.InnerHtml = "当前查询条件总计 - <span style='color:#ff0000; font-weight:bold;'>" + num4 + "</span> 条 记录数据"; string sql = string.Concat(new object[] { "select top ", num, " * from Sys_UserLogin where ", text, " order by id desc" }); if (num2 != 1) { sql = string.Concat(new object[] { "SELECT TOP ", num, " * FROM Sys_UserLogin WHERE id<(SELECT MIN(id) FROM (SELECT TOP ", num3.ToString(), " id FROM Sys_UserLogin WHERE (", text, " ) ORDER BY id DESC) T1) AND (", text, " ) ORDER BY id DESC" }); } this.Bind(sql, this.rpt); this.Page1.sty("meneame", num2, this.GetCountPage(num4, num), "?page="); }
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(); }
private void Show1() { this.type1.Visible = true; if (!string.IsNullOrEmpty(base.Request.QueryString["tid"])) { this.Attend1.Visible = true; } string cmdText = "select a.id,a.AttendNames,a.AttendTimes,b.SignTimes,b.SignJudge,b.Notes,b.id as wid from Work_AttendSet as a left join (select * from Work_Attend where AttendType=1 and UID=" + this.Uid + " and datediff(d,addtime,getdate())=0) as b on a.id=b.AttendTimeID"; using (DataSet dataSet = MsSqlOperate.ExecuteDataset(CommandType.Text, cmdText, new SqlParameter[0])) { this.rpt1.DataSource = dataSet.Tables[0].DefaultView; this.rpt1.DataBind(); } }
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 HtmlForm form1; protected void Page_Load(object sender, EventArgs e) { string cmdText = "select count(id) from Docs_Doc where CreatorID=" + this.Uid; string cmdText2 = string.Concat(new string[] { "select count(id) from Docs_Doc where CreatorID<>", this.Uid, " and IsShare=1 and ShareUsers like '%#", this.Uid, "#%' " }); this.num1 = string.Concat(MsSqlOperate.ExecuteScalar(CommandType.Text, cmdText, null)); this.num2 = string.Concat(MsSqlOperate.ExecuteScalar(CommandType.Text, cmdText2, null)); }