private void BindGrid() { if (tr_Catalog.Nodes.Count > 0) { string ids = new KB_CatalogBLL((int)ViewState["Catalog"]).GetAllChildPosition(); if (ids != "") { ids += ","; } ids += ViewState["Catalog"].ToString(); if ((int)ViewState["SelectCatalog"] != 0) { ids = ViewState["SelectCatalog"].ToString(); } string condition = " KB_Article.IsDelete = 'N' AND KB_Article.Catalog in (" + ids + ") AND (KB_Article.HasApproved = 'Y' OR KB_Article.UploadStaff=" + Session["UserID"].ToString() + ")"; if (ViewState["ConditionString"] != null) { ud_grid.ConditionString = condition + " AND " + ViewState["ConditionString"].ToString() + " Order By ApproveTime Desc"; } else { ud_grid.ConditionString = condition + " Order By ApproveTime Desc"; } ud_grid.BindGrid(); } }
protected void btn_ok_Click(object sender, EventArgs e) { if (int.Parse(MCSTabControl1.SelectedTabItem.Value.ToString()) == 0) { KB_CatalogBLL bll = new KB_CatalogBLL((int)ViewState["Catalog"]); panel1.GetData(bll.Model); bll.Update(); } else if (int.Parse(MCSTabControl1.SelectedTabItem.Value.ToString()) == 1) { KB_CatalogBLL bll = new KB_CatalogBLL(); panel1.GetData(bll.Model); if (bll.Model.SuperID == 0) { bll.Model.SuperID = 1; } bll.Add(); } DataCache.RemoveCache("Cache-TreeTableBLL-GetRelationTableSourceData-MCS_OA.dbo.KB_Catalog-MCS_OA.dbo.KB_Catalog-ID-Name"); DataCache.RemoveCache("Cache-TreeTableBLL-GetAllNode-MCS_OA.dbo.KB_Catalog"); Response.Redirect("CatalogManager.aspx"); //panel1.BindData(bll.Model); }
protected void btn_ok_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(((TextBox)panel1.FindControl("KB_Catalog_Name")).Text.Trim())) { MessageBox.Show(this, "对不起,目录名称不能为空!"); return; } if (int.Parse(MCSTabControl1.SelectedTabItem.Value.ToString()) == 0) { KB_CatalogBLL bll = new KB_CatalogBLL((int)ViewState["Catalog"]); panel1.GetData(bll.Model); bll.Update(); } else if (int.Parse(MCSTabControl1.SelectedTabItem.Value.ToString()) == 1) { KB_CatalogBLL bll = new KB_CatalogBLL(); panel1.GetData(bll.Model); if (bll.Model.SuperID == 0) { bll.Model.SuperID = 1; } bll.Add(); } DataCache.RemoveCache("Cache-TreeTableBLL-GetRelationTableSourceData-MCS_OA.dbo.KB_Catalog-MCS_OA.dbo.KB_Catalog-ID-Name"); DataCache.RemoveCache("Cache-TreeTableBLL-GetAllNode-MCS_OA.dbo.KB_Catalog"); Response.Redirect("CatalogManager.aspx"); //panel1.BindData(bll.Model); }
protected void btn_ok_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(((TextBox)panel1.FindControl("KB_Catalog_Name")).Text.Trim())) { MessageBox.Show(this, "对不起,目录名称不能为空!"); return; } if (int.Parse(MCSTabControl1.SelectedTabItem.Value.ToString()) == 0) { KB_CatalogBLL bll = new KB_CatalogBLL((int)ViewState["Catalog"]); panel1.GetData(bll.Model); bll.Update(); } else if (int.Parse(MCSTabControl1.SelectedTabItem.Value.ToString()) == 1) { KB_CatalogBLL bll = new KB_CatalogBLL(); panel1.GetData(bll.Model); if (bll.Model.SuperID == 0) bll.Model.SuperID = 1; bll.Add(); } DataCache.RemoveCache("Cache-TreeTableBLL-GetRelationTableSourceData-MCS_OA.dbo.KB_Catalog-MCS_OA.dbo.KB_Catalog-ID-Name"); DataCache.RemoveCache("Cache-TreeTableBLL-GetAllNode-MCS_OA.dbo.KB_Catalog"); Response.Redirect("CatalogManager.aspx"); //panel1.BindData(bll.Model); }
private void BindGrid() { string ids = new KB_CatalogBLL((int)ViewState["Catalog"]).GetAllChildPosition(); if (ids != "") { ids += ","; } ids += ViewState["Catalog"].ToString(); string condition = "KB_Article.Catalog in (" + ids + ")"; if (cb_OnlyNoApprove.Checked) { condition += " AND KB_Article.HasApproved= 'N'"; } else { condition += " AND KB_Article.HasApproved= 'Y'"; } if (cb_DisplayDeleted.Checked) { condition += " AND KB_Article.IsDelete = 'Y'"; } else { condition += " AND KB_Article.IsDelete = 'N'"; } ud_grid.ConditionString = condition; ud_grid.BindGrid(); }
private void BindNewKB() { string kbcatalog = ConfigHelper.GetConfigString("DesktopDisplayKBCatalog"); if (string.IsNullOrEmpty(kbcatalog)) { return; } dl_KB.DataSource = KB_CatalogBLL.GetModelList("ID IN (" + kbcatalog + ")"); dl_KB.DataBind(); }
protected void tr_Catalog_SelectedNodeChanged(object sender, EventArgs e) { ViewState["Catalog"] = int.Parse(this.tr_Catalog.SelectedNode.Value); KB_CatalogBLL bll = new KB_CatalogBLL((int)ViewState["Catalog"]); panel1.BindData(bll.Model); if (int.Parse(MCSTabControl1.SelectedTabItem.Value.ToString()) == 1) { ((TextBox)panel1.FindControl("KB_Catalog_Name")).Text = " "; } //BindGrid(); }
private void BindTree(TreeNodeCollection TNC, int SuperID) { IList <KB_Catalog> _list = KB_CatalogBLL.GetModelList("SuperID=" + SuperID.ToString());; foreach (KB_Catalog _m in _list) { TreeNode tn = new TreeNode(); tn.Text = _m.Name; tn.Value = _m.ID.ToString(); TNC.Add(tn); BindTree(tn.ChildNodes, _m.ID); } }
protected void MCSTabControl1_OnTabClicked(object sender, MCSControls.MCSTabControl.MCSTabClickedEventArgs e) { KB_CatalogBLL bll = new KB_CatalogBLL((int)ViewState["Catalog"]); panel1.GetData(bll.Model); switch (MCSTabControl1.SelectedTabItem.Value) { case "0": break; case "1": ((TextBox)panel1.FindControl("KB_Catalog_Name")).Text = " "; break; } //BindGrid(); }
protected void MCSTabControl1_OnTabClicked(object sender, MCSControls.MCSTabControl.MCSTabClickedEventArgs e) { KB_CatalogBLL bll = new KB_CatalogBLL((int)ViewState["Catalog"]); switch (MCSTabControl1.SelectedTabItem.Value) { case "0": panel1.BindData(bll.Model); break; case "1": ((MCSTreeControl)panel1.FindControl("KB_Catalog_SuperID")).SelectValue = bll.Model.ID.ToString(); ((TextBox)panel1.FindControl("KB_Catalog_Name")).Text = ""; break; } //BindGrid(); }
private void BindNewKB() { string kbcatalog = ConfigHelper.GetConfigString("DesktopDisplayKBCatalog"); if (!Roles.IsUserInRole("全体员工")) { kbcatalog = ConfigHelper.GetConfigString("DesktopDisplayKBCatalog2"); hy_KBMore.NavigateUrl += "?RootCatalog=" + kbcatalog; } if (string.IsNullOrEmpty(kbcatalog)) { return; } dl_KB.DataSource = KB_CatalogBLL.GetModelList("ID IN (" + kbcatalog + ")"); dl_KB.DataBind(); }
private void BindGrid() { string ids = new KB_CatalogBLL((int)ViewState["Catalog"]).GetAllChildPosition(); if (ids != "") ids += ","; ids += ViewState["Catalog"].ToString(); string condition = "KB_Article.Catalog in (" + ids + ")"; if (cb_OnlyNoApprove.Checked) condition += " AND KB_Article.HasApproved= 'N'"; else condition += " AND KB_Article.HasApproved= 'Y'"; if (cb_DisplayDeleted.Checked) condition += " AND KB_Article.IsDelete = 'Y'"; else condition += " AND KB_Article.IsDelete = 'N'"; ud_grid.ConditionString = condition; ud_grid.BindGrid(); }
protected void btn_ok_Click(object sender, EventArgs e) { if (int.Parse(MCSTabControl1.SelectedTabItem.Value.ToString()) == 0) { KB_CatalogBLL bll = new KB_CatalogBLL((int)ViewState["Catalog"]); panel1.GetData(bll.Model); bll.Update(); } else if (int.Parse(MCSTabControl1.SelectedTabItem.Value.ToString()) == 1) { KB_CatalogBLL bll = new KB_CatalogBLL(); panel1.GetData(bll.Model); if (bll.Model.SuperID == 0) bll.Model.SuperID = 1; bll.Add(); } DataCache.RemoveCache("Cache-TreeTableBLL-GetRelationTableSourceData-MCS_OA.dbo.KB_Catalog-MCS_OA.dbo.KB_Catalog-ID-Name"); DataCache.RemoveCache("Cache-TreeTableBLL-GetAllNode-MCS_OA.dbo.KB_Catalog"); Response.Redirect("CatalogManager.aspx"); //panel1.BindData(bll.Model); }
private void BindGrid() { if (tr_Catalog.Nodes.Count > 0 || (int)ViewState["Catalog"] > 0) { string ids = new KB_CatalogBLL((int)ViewState["Catalog"]).GetAllChildPosition(); if (ids != "") ids += ","; ids += ViewState["Catalog"].ToString(); string condition = " KB_Article.IsDelete = 'N' AND KB_Article.Catalog in (" + ids + ") AND (KB_Article.HasApproved = 'Y' OR KB_Article.UploadStaff=" + Session["UserID"].ToString() + ")"; ud_grid.ConditionString = condition; if (ViewState["ConditionString"] != null) ud_grid.ConditionString += " AND " + ViewState["ConditionString"].ToString(); ud_grid.BindGrid(); } }