protected void Save_Btn(object sender, EventArgs e) { if (!string.IsNullOrEmpty(base.Request.QueryString["tid"])) { PaperTypeInfo paperTypeInfo = this.ViewState["sd"] as PaperTypeInfo; paperTypeInfo.Notes = this.Notes.Value; paperTypeInfo.TypeName = this.TypeName.Value.Replace("#", "").Replace(",", ""); paperTypeInfo.Orders = Convert.ToInt32(this.Orders.Value); if (Convert.ToInt32(this.parentID.SelectedValue) != paperTypeInfo.id) { paperTypeInfo.ParentID = Convert.ToInt32(this.parentID.SelectedValue); } PaperType.Init().Update(paperTypeInfo); } else { PaperTypeInfo paperTypeInfo = new PaperTypeInfo(); paperTypeInfo.TypeName = this.TypeName.Value.Replace("#", "").Replace(",", ""); paperTypeInfo.Notes = this.Notes.Value; paperTypeInfo.Orders = Convert.ToInt32(this.Orders.Value); paperTypeInfo.ParentID = Convert.ToInt32(this.parentID.SelectedValue); PaperType.Init().Add(paperTypeInfo); } string str = HttpContext.Current.Server.HtmlEncode("您好!档案分类保存成功!"); base.Response.Redirect("~/InfoTip/Operate_Success.aspx?returnpage=../Manage/Paper/PaperType_List.aspx&tip=" + str); }
public void Delete(int id) { PaperTypeInfo paperTypeInfo = new PaperTypeInfo(); paperTypeInfo.id = id; this.control.DeleteEntity(paperTypeInfo); }
protected void Del_Btn(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; string commandArgument = linkButton.CommandArgument; PaperTypeInfo byId = PaperType.Init().GetById(Convert.ToInt32(commandArgument)); this.DeleteDep(byId); this.Show(); }
private void Show(string did) { PaperTypeInfo byId = PaperType.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(PaperTypeInfo sdi) { IList all = PaperType.Init().GetAll("ParentID=" + sdi.id, null); for (int i = 0; i < all.Count; i++) { PaperTypeInfo sdi2 = all[i] as PaperTypeInfo; this.DeleteDep(sdi2); } this.DeletePaper(sdi.id); PaperType.Init().Delete(sdi.id); }
private void GetFirtNode() { DataSet dataSet = MsSqlOperate.ExecuteDataset(CommandType.Text, "select * from PaperType", 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") { PaperTypeInfo paperTypeInfo = this.SetPram(dataRow); paperTypeInfo.Ch = ""; paperTypeInfo.Sh = paperTypeInfo.TypeName; this.li.Add(paperTypeInfo); this.PopulateSubTree(dataRow, this.i); } } }
private void GetFirtNode() { DataSet dataSet = MsSqlOperate.ExecuteDataset(CommandType.Text, "select * from PaperType 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") { PaperTypeInfo paperTypeInfo = this.SetPram(dataRow); paperTypeInfo.Ch = "<img src=../images/ico_browsefolder.gif />"; this.li.Add(paperTypeInfo); 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) { PaperTypeInfo paperTypeInfo = this.li[i]; this.parentID.Items.Add(new ListItem(paperTypeInfo.Sh, string.Concat(paperTypeInfo.id))); i++; } if (!string.IsNullOrEmpty(base.Request.QueryString["tid"])) { this.Show(base.Request.QueryString["tid"]); } } }
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]; PaperTypeInfo paperTypeInfo = this.SetPram(dataRow); if (depth == 2) { if (object.ReferenceEquals(dataRow, childRows[childRows.Length - 1])) { paperTypeInfo.Ch = "\u3000└ "; } else { paperTypeInfo.Ch = "\u3000├ "; } } else { if (depth > 2) { if (object.ReferenceEquals(dataRow, childRows[childRows.Length - 1])) { for (int l = 1; l < depth - 1; l++) { paperTypeInfo.Ch = "\u3000│" + paperTypeInfo.Ch; } PaperTypeInfo expr_132 = paperTypeInfo; expr_132.Ch += "\u3000└ "; } else { for (int l = 1; l < depth - 1; l++) { paperTypeInfo.Ch = "\u3000│" + paperTypeInfo.Ch; } PaperTypeInfo expr_177 = paperTypeInfo; expr_177.Ch += "\u3000├ "; } } } paperTypeInfo.Sh = paperTypeInfo.Ch + paperTypeInfo.TypeName; this.li.Add(paperTypeInfo); this.PopulateSubTree(dataRow, depth); } }
private void Show(string pid) { PaperInfo byId = Paper.Init().GetById(Convert.ToInt32(pid)); PaperTypeInfo byId2 = PaperType.Init().GetById(byId.TypeID); if (byId.ShareDeps.Trim() == "" || byId.ShareDeps.Contains("#" + this.DepID + "#") || byId.CreatorID == Convert.ToInt32(this.Uid) || this.Modules.Contains("53")) { this.TypeName.InnerText = "[" + byId2.TypeName + "] "; this.PaperName.InnerText = byId.PaperName; try { this.PaperDate.InnerText = byId.PaperDate + " (" + Utils.ConvertDate4(Convert.ToDateTime(string.Concat(new string[] { byId.PaperDate.Substring(0, 4), "-", byId.PaperDate.Substring(4, 2), "-", byId.PaperDate.Substring(6, 2) }))) + ")"; } catch { this.PaperDate.InnerText = "错误的日期格式!"; } this.SendDep.InnerText = byId.SendDep; this.PaperSymbol.InnerText = byId.PaperSymbol; this.PaperGrade.InnerText = byId.PaperGrade; this.Notes.InnerText = byId.Notes; if (byId.ShareDeps.Contains(",")) { string text = ""; string[] array = byId.ShareDeps.Split(new char[] { ',' }); for (int i = 0; i < array.Length; i++) { if (array[i].Contains("#")) { text = text + array[i].Split(new char[] { '#' })[0] + " "; } } this.namelist_dep.InnerText = text; } else { this.namelist_dep.InnerText = "全体人员"; } if (!string.IsNullOrEmpty(byId.FilePath)) { this.fjs = ""; string[] array = byId.FilePath.Split(new char[] { '|' }); for (int i = 0; i < array.Length; i++) { if (array[i].Trim() != "") { int num = array[i].LastIndexOf('/') + 1; string arg = array[i].Substring(num, array[i].Length - num); string s = array[i].Replace("~", ""); this.fjs += string.Format(this.fj, base.Server.UrlEncode(s), arg, pid); } } } } else { base.Response.Write("<script>alert('您没有查看权限');</script>"); } }
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]; PaperTypeInfo paperTypeInfo = this.SetPram(dataRow); string text = "<img src=../images/ico_intro.gif />"; if (depth == 2) { if (object.ReferenceEquals(dataRow, childRows[childRows.Length - 1])) { paperTypeInfo.Ch = "\u3000└ " + text; } else { paperTypeInfo.Ch = "\u3000├ " + text; } } else { if (depth > 2) { if (object.ReferenceEquals(dataRow, childRows[childRows.Length - 1])) { for (int l = 1; l < depth - 1; l++) { paperTypeInfo.Ch = "\u3000│" + paperTypeInfo.Ch; } PaperTypeInfo expr_14E = paperTypeInfo; expr_14E.Ch = expr_14E.Ch + "\u3000└ " + text; } else { for (int l = 1; l < depth - 1; l++) { paperTypeInfo.Ch = "\u3000│" + paperTypeInfo.Ch; } PaperTypeInfo expr_195 = paperTypeInfo; expr_195.Ch = expr_195.Ch + "\u3000├ " + text; } } } this.li.Add(paperTypeInfo); this.PopulateSubTree(dataRow, depth); } }
private void Show() { IList all = PaperType.Init().GetAll(null, null); this.TypeID.Items.Clear(); this.TypeID.Items.Add(new ListItem("所有电子档案分类", "")); foreach (object current in all) { PaperTypeInfo paperTypeInfo = current as PaperTypeInfo; this.TypeID.Items.Add(new ListItem(paperTypeInfo.TypeName, string.Concat(paperTypeInfo.id))); } IList list = null; if (!string.IsNullOrEmpty(base.Request.QueryString["TypeID"]) || !string.IsNullOrEmpty(base.Request.QueryString["PaperName"]) || !string.IsNullOrEmpty(base.Request.QueryString["PaperSymbol"]) || !string.IsNullOrEmpty(base.Request.QueryString["SendDep"]) || !string.IsNullOrEmpty(base.Request.QueryString["PaperGrade"]) || !string.IsNullOrEmpty(base.Request.QueryString["StartTime"]) || !string.IsNullOrEmpty(base.Request.QueryString["EndTime"])) { string text = base.Request.QueryString["TypeID"]; string text2 = base.Request.QueryString["PaperName"]; string text3 = base.Request.QueryString["PaperSymbol"]; string text4 = base.Request.QueryString["SendDep"]; string text5 = base.Request.QueryString["PaperGrade"]; string text6 = base.Request.QueryString["StartTime"]; string text7 = base.Request.QueryString["EndTime"]; string text8 = " 1=1 "; if (!string.IsNullOrEmpty(text)) { text8 = text8 + " and (TypeID=" + text + ") "; } if (!string.IsNullOrEmpty(text2)) { text8 = text8 + " and (PaperName like '%" + text2 + "%') "; } if (!string.IsNullOrEmpty(text3)) { text8 = text8 + " and (PaperSymbol like '%" + text3 + "%') "; } if (!string.IsNullOrEmpty(text4)) { text8 = text8 + " and (SendDep like '%" + text4 + "%') "; } if (!string.IsNullOrEmpty(text5)) { text8 = text8 + " and (PaperGrade like '%" + text5 + "%') "; } if (!string.IsNullOrEmpty(text6) && !string.IsNullOrEmpty(text7)) { string text9 = text8; text8 = string.Concat(new string[] { text9, " and (PaperDate between '", text6, "' and '", text7, "')" }); } if (!string.IsNullOrEmpty(text6) && string.IsNullOrEmpty(text7)) { text8 = text8 + " and (PaperDate between '" + text6 + "' and getdate())"; } if (string.IsNullOrEmpty(text6) && !string.IsNullOrEmpty(text7)) { text8 = text8 + " and (PaperDate between getdate() and '" + text7 + "')"; } list = Paper.Init().GetAll(text8, "order by id desc"); } else { list = Paper.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["PaperName"] == null) { this.Page2.sty("meneame", num, pagedDataSource.PageCount, "?page="); } if (base.Request.QueryString["PaperName"] != null) { this.Page2.sty("meneame", num, pagedDataSource.PageCount, string.Concat(new string[] { "?PaperName=", base.Request.QueryString["PaperName"], "&TypeID=", base.Request.QueryString["TypeID"], "&PaperSymbol=", base.Request.QueryString["PaperSymbol"], "&SendDep=", base.Request.QueryString["SendDep"], "&PaperGrade=", base.Request.QueryString["PaperGrade"], "&StartTime=", base.Request.QueryString["StartTime"], "&EndTime=", base.Request.QueryString["EndTime"], "&page=" })); } this.num.InnerHtml = "当前查询条件总计 - <span style='color:#ff0000; font-weight:bold;'>" + list.Count + "</span> 条 记录数据"; }
public void Update(PaperTypeInfo com) { PaperType.dal.Update(com); }
public void Add(PaperTypeInfo com) { PaperType.dal.Add(com); }
public void Update(PaperTypeInfo PaperType_) { this.control.UpdateEntity(PaperType_, PaperType_.id); }
public void Add(PaperTypeInfo PaperType_) { this.control.AddEntity(PaperType_); }