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); }
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 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); }