private void Show() { if (this.ModelName.Visible) { IList all = Flows_ModelFile.Init().GetAll(null, null); this.ModelFileList.Items.Add(new ListItem("请从以下 模板表单库中 选择一项 (酌情 可不选) ", "0")); foreach (object current in all) { Flows_ModelFileInfo flows_ModelFileInfo = current as Flows_ModelFileInfo; this.ModelFileList.Items.Add(new ListItem(flows_ModelFileInfo.FormTitle, string.Concat(flows_ModelFileInfo.id))); } this.GetFirtNode(); this.Model_Type.Items.Add(new ListItem("不属于任何分类", "0")); int 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.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"])) { Flows_Model_TypeInfo flows_Model_TypeInfo = this.ViewState["sd"] as Flows_Model_TypeInfo; flows_Model_TypeInfo.Notes = this.Notes.Value; flows_Model_TypeInfo.TypeName = this.TypeName.Value.Replace("#", "").Replace(",", ""); flows_Model_TypeInfo.Orders = Convert.ToInt32(this.Orders.Value); if (Convert.ToInt32(this.parentID.SelectedValue) != flows_Model_TypeInfo.id) { flows_Model_TypeInfo.ParentID = Convert.ToInt32(this.parentID.SelectedValue); } Flows_Model_Type.Init().Update(flows_Model_TypeInfo); } else { Flows_Model_TypeInfo flows_Model_TypeInfo = new Flows_Model_TypeInfo(); flows_Model_TypeInfo.TypeName = this.TypeName.Value.Replace("#", "").Replace(",", ""); flows_Model_TypeInfo.Notes = this.Notes.Value; flows_Model_TypeInfo.Orders = Convert.ToInt32(this.Orders.Value); flows_Model_TypeInfo.ParentID = Convert.ToInt32(this.parentID.SelectedValue); Flows_Model_Type.Init().Add(flows_Model_TypeInfo); } string str = HttpContext.Current.Server.HtmlEncode("您好!流程模型分类保存成功!"); base.Response.Redirect("~/InfoTip/Operate_Success.aspx?returnpage=../Manage/Flow/FlowType_List.aspx&tip=" + str); }
public void Delete(int id) { Flows_Model_TypeInfo flows_Model_TypeInfo = new Flows_Model_TypeInfo(); flows_Model_TypeInfo.id = id; this.control.DeleteEntity(flows_Model_TypeInfo); }
protected void Del_Btn(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; string commandArgument = linkButton.CommandArgument; Flows_Model_TypeInfo byId = Flows_Model_Type.Init().GetById(Convert.ToInt32(commandArgument)); this.DeleteDep(byId); this.Show(); }
private void Show(string did) { Flows_Model_TypeInfo byId = Flows_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 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")); }
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); }
private string GetModelType(int comid) { string result = "暂无分类"; if (comid > 0) { IList all = Flows_Model_Type.Init().GetAll("id=" + comid, null); if (all.Count > 0) { Flows_Model_TypeInfo flows_Model_TypeInfo = all[0] as Flows_Model_TypeInfo; result = flows_Model_TypeInfo.TypeName; } } return(result); }
private void GetFirtNode() { DataSet dataSet = MsSqlOperate.ExecuteDataset(CommandType.Text, "select * from Flows_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") { Flows_Model_TypeInfo flows_Model_TypeInfo = this.SetPram(dataRow); flows_Model_TypeInfo.Ch = ""; flows_Model_TypeInfo.Sh = flows_Model_TypeInfo.TypeName; this.li.Add(flows_Model_TypeInfo); this.PopulateSubTree(dataRow, this.i); } } }
private void GetFirtNode() { DataSet dataSet = MsSqlOperate.ExecuteDataset(CommandType.Text, "select * from Flows_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") { Flows_Model_TypeInfo flows_Model_TypeInfo = this.SetPram(dataRow); flows_Model_TypeInfo.Ch = "<img src=../images/ico_browsefolder.gif />"; this.li.Add(flows_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) { Flows_Model_TypeInfo flows_Model_TypeInfo = this.li[i]; this.parentID.Items.Add(new ListItem(flows_Model_TypeInfo.Sh, string.Concat(flows_Model_TypeInfo.id))); i++; } if (!string.IsNullOrEmpty(base.Request.QueryString["tid"])) { this.Show(base.Request.QueryString["tid"]); } } }
public void Update(Flows_Model_TypeInfo com) { Flows_Model_Type.dal.Update(com); }
public void Update(Flows_Model_TypeInfo Flows_Model_Type_) { this.control.UpdateEntity(Flows_Model_Type_, Flows_Model_Type_.id); }
public void Add(Flows_Model_TypeInfo Flows_Model_Type_) { this.control.AddEntity(Flows_Model_Type_); }
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]; Flows_Model_TypeInfo flows_Model_TypeInfo = this.SetPram(dataRow); if (depth == 2) { if (object.ReferenceEquals(dataRow, childRows[childRows.Length - 1])) { flows_Model_TypeInfo.Ch = "\u3000└ "; } else { flows_Model_TypeInfo.Ch = "\u3000├ "; } } else { if (depth > 2) { if (object.ReferenceEquals(dataRow, childRows[childRows.Length - 1])) { for (int l = 1; l < depth - 1; l++) { flows_Model_TypeInfo.Ch = "\u3000│" + flows_Model_TypeInfo.Ch; } Flows_Model_TypeInfo expr_132 = flows_Model_TypeInfo; expr_132.Ch += "\u3000└ "; } else { for (int l = 1; l < depth - 1; l++) { flows_Model_TypeInfo.Ch = "\u3000│" + flows_Model_TypeInfo.Ch; } Flows_Model_TypeInfo expr_177 = flows_Model_TypeInfo; expr_177.Ch += "\u3000├ "; } } } flows_Model_TypeInfo.Sh = flows_Model_TypeInfo.Ch + flows_Model_TypeInfo.TypeName; this.li.Add(flows_Model_TypeInfo); this.PopulateSubTree(dataRow, depth); } }
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]; Flows_Model_TypeInfo flows_Model_TypeInfo = this.SetPram(dataRow); string text = "<img src=../images/ico_intro.gif />"; if (depth == 2) { if (object.ReferenceEquals(dataRow, childRows[childRows.Length - 1])) { flows_Model_TypeInfo.Ch = "\u3000└ " + text; } else { flows_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++) { flows_Model_TypeInfo.Ch = "\u3000│" + flows_Model_TypeInfo.Ch; } Flows_Model_TypeInfo expr_14E = flows_Model_TypeInfo; expr_14E.Ch = expr_14E.Ch + "\u3000└ " + text; } else { for (int l = 1; l < depth - 1; l++) { flows_Model_TypeInfo.Ch = "\u3000│" + flows_Model_TypeInfo.Ch; } Flows_Model_TypeInfo expr_195 = flows_Model_TypeInfo; expr_195.Ch = expr_195.Ch + "\u3000├ " + text; } } } this.li.Add(flows_Model_TypeInfo); this.PopulateSubTree(dataRow, depth); } }
public void Add(Flows_Model_TypeInfo com) { Flows_Model_Type.dal.Add(com); }