public void Delete(int id) { Gov_Model_TypeInfo gov_Model_TypeInfo = new Gov_Model_TypeInfo(); gov_Model_TypeInfo.id = id; this.control.DeleteEntity(gov_Model_TypeInfo); }
private void Show() { if (this.ModelName.Visible) { IList all = Gov_ModelFile.Init().GetAll(null, null); this.ModelFileList.Items.Add(new ListItem("请从以下 公文模板表单库中 选择一项 (请 酌情选择) ", "0")); foreach (object current in all) { Gov_ModelFileInfo gov_ModelFileInfo = current as Gov_ModelFileInfo; this.ModelFileList.Items.Add(new ListItem(gov_ModelFileInfo.FormTitle, string.Concat(gov_ModelFileInfo.id))); } this.GetFirtNode(); this.Model_Type.Items.Add(new ListItem("不属于任何分类", "0")); int i = 0; int count = this.li.Count; while (i < count) { Gov_Model_TypeInfo gov_Model_TypeInfo = this.li[i]; this.Model_Type.Items.Add(new ListItem(gov_Model_TypeInfo.Sh, string.Concat(gov_Model_TypeInfo.id))); i++; } this.ViewState["max count"] = 0; this.ViewState["current count"] = 0; this.ViewState["isadd"] = 0; this.ViewState["fm"] = 0; } }
protected void Save_Btn(object sender, EventArgs e) { if (!string.IsNullOrEmpty(base.Request.QueryString["tid"])) { Gov_Model_TypeInfo gov_Model_TypeInfo = this.ViewState["sd"] as Gov_Model_TypeInfo; gov_Model_TypeInfo.Notes = this.Notes.Value; gov_Model_TypeInfo.TypeName = this.TypeName.Value.Replace("#", "").Replace(",", ""); gov_Model_TypeInfo.Orders = Convert.ToInt32(this.Orders.Value); if (Convert.ToInt32(this.parentID.SelectedValue) != gov_Model_TypeInfo.id) { gov_Model_TypeInfo.ParentID = Convert.ToInt32(this.parentID.SelectedValue); } Gov_Model_Type.Init().Update(gov_Model_TypeInfo); } else { Gov_Model_TypeInfo gov_Model_TypeInfo = new Gov_Model_TypeInfo(); gov_Model_TypeInfo.TypeName = this.TypeName.Value.Replace("#", "").Replace(",", ""); gov_Model_TypeInfo.Notes = this.Notes.Value; gov_Model_TypeInfo.Orders = Convert.ToInt32(this.Orders.Value); gov_Model_TypeInfo.ParentID = Convert.ToInt32(this.parentID.SelectedValue); Gov_Model_Type.Init().Add(gov_Model_TypeInfo); } string str = HttpContext.Current.Server.HtmlEncode("您好!公文模型分类保存成功!"); base.Response.Redirect("~/InfoTip/Operate_Success.aspx?returnpage=../../Manage/Gov/GovType_List.aspx&tip=" + str); }
protected void Del_Btn(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; string commandArgument = linkButton.CommandArgument; Gov_Model_TypeInfo byId = Gov_Model_Type.Init().GetById(Convert.ToInt32(commandArgument)); this.DeleteDep(byId); this.Show(); }
private void Show(string did) { Gov_Model_TypeInfo byId = Gov_Model_Type.Init().GetById(Convert.ToInt32(did)); this.ViewState["sd"] = byId; this.parentID.SelectedValue = string.Concat(byId.ParentID); this.TypeName.Value = byId.TypeName; this.Notes.Value = byId.Notes; this.Orders.Value = string.Concat(byId.Orders); }
private void DeleteDep(Gov_Model_TypeInfo sdi) { IList all = Gov_Model_Type.Init().GetAll("ParentID=" + sdi.id, null); for (int i = 0; i < all.Count; i++) { Gov_Model_TypeInfo sdi2 = all[i] as Gov_Model_TypeInfo; this.DeleteDep(sdi2); } string cmdText = "delete from Gov_Model where comid=" + sdi.id; MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText, new SqlParameter[0]); Gov_Model_Type.Init().Delete(sdi.id); }
private string GetModelType(int comid) { string result = "暂无分类"; if (comid > 0) { IList all = Gov_Model_Type.Init().GetAll("id=" + comid, null); if (all.Count > 0) { Gov_Model_TypeInfo gov_Model_TypeInfo = all[0] as Gov_Model_TypeInfo; result = gov_Model_TypeInfo.TypeName; } } return result; }
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[] cmdParms = new SqlParameter[] { sqlParameter2, sqlParameter3, sqlParameter4, sqlParameter }; MsSqlOperate.ExecuteNonQuery(CommandType.StoredProcedure, "Gov_GetUserFlowBoxCount", cmdParms); this.wdpy.InnerText = string.Concat(sqlParameter2.Value); this.yjpy.InnerText = string.Concat(sqlParameter3.Value); this.wdsq.InnerText = string.Concat(sqlParameter4.Value); IList all = Gov_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++) { Gov_ModelInfo gov_ModelInfo = all[i] as Gov_ModelInfo; this.ModelFlowList.Items.Add(new ListItem(gov_ModelInfo.Flow_Name, gov_ModelInfo.id + "," + gov_ModelInfo.ModelFileID)); } this.GetFirtNode(); this.Model_Type.Items.Add(new ListItem("== 请选择一个分类", "-1")); i = 0; int count = this.li.Count; while (i < count) { Gov_Model_TypeInfo gov_Model_TypeInfo = this.li[i]; this.Model_Type.Items.Add(new ListItem(gov_Model_TypeInfo.Sh, string.Concat(gov_Model_TypeInfo.id))); i++; } this.Model_Type.Items.Add(new ListItem("不属于任何分类", "0")); }
private void GetFirtNode() { DataSet dataSet = MsSqlOperate.ExecuteDataset(CommandType.Text, "select * from Gov_Model_Type", null); dataSet.Relations.Add("sort", dataSet.Tables[0].Columns["id"], dataSet.Tables[0].Columns["ParentID"], false); foreach (DataRow dataRow in dataSet.Tables[0].Rows) { if (dataRow["ParentID"].ToString() == "0") { Gov_Model_TypeInfo gov_Model_TypeInfo = this.SetPram(dataRow); gov_Model_TypeInfo.Ch = ""; gov_Model_TypeInfo.Sh = gov_Model_TypeInfo.TypeName; this.li.Add(gov_Model_TypeInfo); this.PopulateSubTree(dataRow, this.i); } } }
private void GetFirtNode() { DataSet dataSet = MsSqlOperate.ExecuteDataset(CommandType.Text, "select * from Gov_Model_Type order by orders asc", null); dataSet.Relations.Add("sort", dataSet.Tables[0].Columns["id"], dataSet.Tables[0].Columns["ParentID"], false); foreach (DataRow dataRow in dataSet.Tables[0].Rows) { if (dataRow["ParentID"].ToString() == "0") { Gov_Model_TypeInfo gov_Model_TypeInfo = this.SetPram(dataRow); gov_Model_TypeInfo.Ch = "<img src=../images/ico_browsefolder.gif />"; this.li.Add(gov_Model_TypeInfo); this.PopulateSubTree(dataRow, this.i); } } dataSet.Dispose(); }
protected void Page_Load(object sender, EventArgs e) { if (!base.IsPostBack) { this.GetFirtNode(); this.parentID.Items.Add(new ListItem("作为根分类", "0")); int i = 0; int count = this.li.Count; while (i < count) { Gov_Model_TypeInfo gov_Model_TypeInfo = this.li[i]; this.parentID.Items.Add(new ListItem(gov_Model_TypeInfo.Sh, string.Concat(gov_Model_TypeInfo.id))); i++; } if (!string.IsNullOrEmpty(base.Request.QueryString["tid"])) { this.Show(base.Request.QueryString["tid"]); } } }
public void Update(Gov_Model_TypeInfo com) { Gov_Model_Type.dal.Update(com); }
public void Add(Gov_Model_TypeInfo com) { Gov_Model_Type.dal.Add(com); }
private void PopulateSubTree(DataRow dbRow, int depth) { depth++; DataRow[] childRows = dbRow.GetChildRows("sort"); for (int i = 0; i < childRows.Length - 1; i++) { int num = i; for (int j = i + 1; j < childRows.Length; j++) { if (Convert.ToInt32(childRows[num]["Orders"]) > Convert.ToInt32(childRows[j]["Orders"])) { num = j; } } if (num != i) { object obj = childRows[i]; childRows[i] = childRows[num]; childRows[num] = (DataRow)obj; } } DataRow[] array = childRows; for (int k = 0; k < array.Length; k++) { DataRow dataRow = array[k]; Gov_Model_TypeInfo gov_Model_TypeInfo = this.SetPram(dataRow); if (depth == 2) { if (object.ReferenceEquals(dataRow, childRows[childRows.Length - 1])) { gov_Model_TypeInfo.Ch = "\u3000└ "; } else { gov_Model_TypeInfo.Ch = "\u3000├ "; } } else { if (depth > 2) { if (object.ReferenceEquals(dataRow, childRows[childRows.Length - 1])) { for (int l = 1; l < depth - 1; l++) { gov_Model_TypeInfo.Ch = "\u3000│" + gov_Model_TypeInfo.Ch; } Gov_Model_TypeInfo expr_132 = gov_Model_TypeInfo; expr_132.Ch += "\u3000└ "; } else { for (int l = 1; l < depth - 1; l++) { gov_Model_TypeInfo.Ch = "\u3000│" + gov_Model_TypeInfo.Ch; } Gov_Model_TypeInfo expr_177 = gov_Model_TypeInfo; expr_177.Ch += "\u3000├ "; } } } gov_Model_TypeInfo.Sh = gov_Model_TypeInfo.Ch + gov_Model_TypeInfo.TypeName; this.li.Add(gov_Model_TypeInfo); this.PopulateSubTree(dataRow, depth); } }
private void Show() { this.GetFirtNode(); this.Model_Type.Items.Add(new ListItem("== 列出所有公文模型分类", "-1")); int i = 0; int count = this.li.Count; while (i < count) { Gov_Model_TypeInfo gov_Model_TypeInfo = this.li[i]; this.Model_Type.Items.Add(new ListItem(gov_Model_TypeInfo.Sh, string.Concat(gov_Model_TypeInfo.id))); i++; } this.Model_Type.Items.Add(new ListItem("不属于任何分类", "0")); IList all = Gov_Model.Init().GetAll(null, null); this.Model.Items.Clear(); this.Model.Items.Add(new ListItem("所有公文模型", "")); foreach (object current in all) { Gov_ModelInfo gov_ModelInfo = current as Gov_ModelInfo; this.Model.Items.Add(new ListItem(gov_ModelInfo.Flow_Name, gov_ModelInfo.Flow_Name)); } IList list = null; if (!string.IsNullOrEmpty(base.Request.QueryString["keywords"]) || !string.IsNullOrEmpty(base.Request.QueryString["md"]) || !string.IsNullOrEmpty(base.Request.QueryString["st"]) || !string.IsNullOrEmpty(base.Request.QueryString["et"]) || !string.IsNullOrEmpty(base.Request.QueryString["stt"])) { string text = base.Request.QueryString["keywords"]; string text2 = string.Concat(new string[] { " (flow_name like '%", text, "%' or CurrentStepName like '%", text, "%' or CreatorRealName like '%", text, "%' ) " }); string text3 = base.Request.QueryString["md"]; string text4 = base.Request.QueryString["st"]; string text5 = base.Request.QueryString["et"]; string text6 = base.Request.QueryString["stt"]; if (string.IsNullOrEmpty(text)) { text2 = " 1=1 "; } if (!string.IsNullOrEmpty(text6)) { text2 = text2 + " and (status=" + text6 + ") "; } if (!string.IsNullOrEmpty(text3)) { text2 = text2 + " and (ModelName='" + text3 + "') "; } if (!string.IsNullOrEmpty(text4) && !string.IsNullOrEmpty(text5)) { string text7 = text2; text2 = string.Concat(new string[] { text7, " and (addtime between '", text4, "' and '", text5, "')" }); } if (!string.IsNullOrEmpty(text4) && string.IsNullOrEmpty(text5)) { text2 = text2 + " and (addtime between '" + text4 + "' and getdate())"; } if (string.IsNullOrEmpty(text4) && !string.IsNullOrEmpty(text5)) { text2 = text2 + " and (addtime between getdate() and '" + text5 + "')"; } list = Gov.Init().GetAll(text2, "order by id desc"); } else { list = Gov.Init().GetAll(null, "order by id desc"); } Hashtable hashtable = (Hashtable)HttpContext.Current.Application["config_fenye"]; int pageSize = Convert.ToInt32(hashtable["fenye_commom"]); 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(); pagedDataSource.DataSource = list; pagedDataSource.AllowPaging = true; pagedDataSource.PageSize = pageSize; pagedDataSource.CurrentPageIndex = num - 1; this.rpt.DataSource = pagedDataSource; this.rpt.DataBind(); if (base.Request.QueryString["keywords"] == null) { this.Page2.sty("meneame", num, pagedDataSource.PageCount, "?page="); } if (base.Request.QueryString["keywords"] != null) { this.Page2.sty("meneame", num, pagedDataSource.PageCount, string.Concat(new string[] { "?keywords=", base.Request.QueryString["keywords"], "&stt=", base.Request.QueryString["stt"], "&md=", base.Request.QueryString["md"], "&st=", base.Request.QueryString["st"], "&et=", base.Request.QueryString["et"], "&page=" })); } this.num.InnerHtml = "当前查询条件总计 - <span style='color:#ff0000; font-weight:bold;'>" + list.Count + "</span> 条 记录数据"; }
private void PopulateSubTree(DataRow dbRow, int depth) { depth++; DataRow[] childRows = dbRow.GetChildRows("sort"); for (int i = 0; i < childRows.Length - 1; i++) { int num = i; for (int j = i + 1; j < childRows.Length; j++) { if (Convert.ToInt32(childRows[num]["orders"]) > Convert.ToInt32(childRows[j]["orders"])) { num = j; } } if (num != i) { object obj = childRows[i]; childRows[i] = childRows[num]; childRows[num] = (DataRow)obj; } } DataRow[] array = childRows; for (int k = 0; k < array.Length; k++) { DataRow dataRow = array[k]; Gov_Model_TypeInfo gov_Model_TypeInfo = this.SetPram(dataRow); string text = "<img src=../images/ico_intro.gif />"; if (depth == 2) { if (object.ReferenceEquals(dataRow, childRows[childRows.Length - 1])) { gov_Model_TypeInfo.Ch = "\u3000└ " + text; } else { gov_Model_TypeInfo.Ch = "\u3000├ " + text; } } else { if (depth > 2) { if (object.ReferenceEquals(dataRow, childRows[childRows.Length - 1])) { for (int l = 1; l < depth - 1; l++) { gov_Model_TypeInfo.Ch = "\u3000│" + gov_Model_TypeInfo.Ch; } Gov_Model_TypeInfo expr_14E = gov_Model_TypeInfo; expr_14E.Ch = expr_14E.Ch + "\u3000└ " + text; } else { for (int l = 1; l < depth - 1; l++) { gov_Model_TypeInfo.Ch = "\u3000│" + gov_Model_TypeInfo.Ch; } Gov_Model_TypeInfo expr_195 = gov_Model_TypeInfo; expr_195.Ch = expr_195.Ch + "\u3000├ " + text; } } } this.li.Add(gov_Model_TypeInfo); this.PopulateSubTree(dataRow, depth); } }
public void Update(Gov_Model_TypeInfo Gov_Model_Type_) { this.control.UpdateEntity(Gov_Model_Type_, Gov_Model_Type_.id); }
public void Add(Gov_Model_TypeInfo Gov_Model_Type_) { this.control.AddEntity(Gov_Model_Type_); }