Esempio n. 1
0
        private void BiudTree()
        {
            Maticsoft.BLL.SysManageBLL sm = new Maticsoft.BLL.SysManageBLL();
            DataTable dt = sm.GetTreeList("").Tables[0];

            this.listTarget.Items.Clear();
            //加载树
            this.listTarget.Items.Add(new ListItem("根目录", "0"));
            DataRow[] drs = dt.Select("ParentID= " + 0);

            foreach (DataRow r in drs)
            {
                string nodeid       = r["NodeID"].ToString();
                string text         = r["Text"].ToString();
                string parentid     = r["ParentID"].ToString();
                string permissionid = r["PermissionID"].ToString();
                text = "╋" + text;
                this.listTarget.Items.Add(new ListItem(text, nodeid));
                int    sonparentid = int.Parse(nodeid);
                string blank       = "├";

                BindNode(sonparentid, dt, blank);
            }
            this.listTarget.DataBind();
        }
Esempio n. 2
0
        private void dataBind(int pageIndex)
        {
            pageIndex--;
            Maticsoft.BLL.SysManageBLL sm = new Maticsoft.BLL.SysManageBLL();
            DataSet ds = new DataSet();

            ds = sm.GetLogs("");
            grid.DataSource = ds.Tables[0].DefaultView;
            int record_Count = ds.Tables[0].Rows.Count;
            int page_Size    = grid.PageSize;
            int totalPages   = int.Parse(Math.Ceiling((double)record_Count / page_Size).ToString());

            if (totalPages > 0)
            {
                if ((pageIndex + 1) > totalPages)
                {
                    pageIndex = totalPages - 1;
                }
            }
            else
            {
                pageIndex = 0;
            }
            grid.CurrentPageIndex = pageIndex;
            grid.DataBind();
            int page_Count   = grid.PageCount;
            int page_Current = pageIndex + 1;

            Page021.Page_Count   = page_Count;
            Page021.Page_Size    = page_Size;
            Page021.Page_Current = page_Current;
        }
Esempio n. 3
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         Maticsoft.BLL.SysManageBLL sm = new Maticsoft.BLL.SysManageBLL();
         string id = Request.Params["id"];
         sm.DelTreeNode(int.Parse(id));
         Response.Redirect("treelist.aspx");
     }
 }
Esempio n. 4
0
        private void dataBind(int pageIndex)
        {
            pageIndex--;
            Maticsoft.BLL.SysManageBLL sm = new Maticsoft.BLL.SysManageBLL();
            string strWhere = "";

            if (Session["strWheresys"] != null && Session["strWheresys"].ToString() != "")
            {
                strWhere = Session["strWheresys"].ToString();
            }
            if (listTarget.SelectedItem != null)
            {
                string nodeid = listTarget.SelectedValue;
                if (strWhere.Trim() != "")
                {
                    strWhere = strWhere + " and ";
                }
                strWhere += "ParentID= " + nodeid;
            }

            DataSet ds = new DataSet();

            ds = sm.GetTreeList(strWhere);
            grid.DataSource = ds.Tables[0].DefaultView;
            int record_Count = ds.Tables[0].Rows.Count;
            int page_Size    = grid.PageSize;
            int totalPages   = int.Parse(Math.Ceiling((double)record_Count / page_Size).ToString());

            if (totalPages > 0)
            {
                if ((pageIndex + 1) > totalPages)
                {
                    pageIndex = totalPages - 1;
                }
            }
            else
            {
                pageIndex = 0;
            }
            grid.CurrentPageIndex = pageIndex;
            grid.DataBind();
            int page_Count   = grid.PageCount;
            int page_Current = pageIndex + 1;

            Page011.Record_Count = record_Count;
            Page011.Page_Count   = page_Count;
            Page021.Page_Count   = page_Count;

            Page011.Page_Size    = page_Size;
            Page021.Page_Size    = page_Size;
            Page011.Page_Current = page_Current;
            Page021.Page_Current = page_Current;
        }
Esempio n. 5
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
         {
             string id = Request.Params["id"];
             Maticsoft.BLL.SysManageBLL sm = new Maticsoft.BLL.SysManageBLL();
             DataRow row = sm.GetLog(id);
             strtime    = row["datetime"].ToString();
             errmsg     = row["loginfo"].ToString();
             Particular = row["Particular"].ToString().Replace("\r\n", "<br>");
         }
     }
 }
Esempio n. 6
0
        //邦定根节点
        public void BindTreeView()
        {
            Maticsoft.BLL.SysManageBLL bll = new Maticsoft.BLL.SysManageBLL();
            DataTable dt = bll.GetTreeList("").Tables[0];

            DataRow[] drs = dt.Select("ParentID= " + 0);//选出所有子节点

            //菜单状态
            bool menuExpand = false;

            TreeView1.Nodes.Clear(); // 清空树
            foreach (DataRow r in drs)
            {
                string nodeid       = r["NodeID"].ToString();
                string text         = r["Text"].ToString();
                string parentid     = r["ParentID"].ToString();
                string location     = r["Location"].ToString();
                string url          = r["Url"].ToString();
                string imageurl     = r["ImageUrl"].ToString();
                int    permissionid = int.Parse(r["PermissionID"].ToString().Trim());

                //treeview set
                this.TreeView1.Font.Name = "宋体";
                this.TreeView1.Font.Size = FontUnit.Parse("9");

                Microsoft.Web.UI.WebControls.TreeNode rootnode = new Microsoft.Web.UI.WebControls.TreeNode();
                rootnode.Text = text + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"modify.aspx?id=" + nodeid + "\">修改</a> " +
                                "&nbsp;&nbsp;&nbsp;&nbsp;<a onClick=\"if (!window.confirm('您真的要删除这条记录吗?')){return false;}\" href=\"delete.aspx?id=" + nodeid + "\">删除</a>" +
                                "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"add.aspx?nodeid=" + nodeid + "\">增加节点</a>";
                rootnode.NodeData = nodeid;
                //rootnode.NavigateUrl = url;
                //rootnode.Target = framename;
                rootnode.Expanded = menuExpand;
                rootnode.ImageUrl = "../" + imageurl;

                TreeView1.Nodes.Add(rootnode);

                int sonparentid = int.Parse(nodeid);// or =location
                CreateNode(sonparentid, rootnode, dt);
            }
        }
Esempio n. 7
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                user = new AccountsPrincipal(Context.User.Identity.Name);
                if (Session["UserInfo"] == null)
                {
                    return;
                }
                currentUser = (LTP.Accounts.Bus.User)Session["UserInfo"];
                Maticsoft.BLL.SysManageBLL sm = new Maticsoft.BLL.SysManageBLL();
                DataSet ds;
                ds = sm.GetTreeList("");
                BindTreeView("mainFrame", ds.Tables[0]);

                if (this.TreeView1.Nodes.Count == 0)
                {
                    strWelcome += "<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;但你没有任何模块的访问权";
                }
            }
        }
Esempio n. 8
0
        protected void Confirm_Click(object sender, System.EventArgs e)
        {
            string dgIDs   = "";
            bool   BxsChkd = false;

            foreach (DataGridItem item in grid.Items)
            {
                CheckBox deleteChkBxItem = (CheckBox)item.FindControl("DeleteThis");
                if (deleteChkBxItem.Checked)
                {
                    BxsChkd = true;
                    dgIDs  += item.Cells[0].Text + ",";
                }
            }
            if (BxsChkd)
            {
                dgIDs = dgIDs.Substring(0, dgIDs.LastIndexOf(","));
                Maticsoft.BLL.SysManageBLL sm = new Maticsoft.BLL.SysManageBLL();
                sm.DeleteLog(dgIDs);
                Response.Redirect("logindex.aspx");
            }
        }
Esempio n. 9
0
        private void ShowInfo(string id)
        {
            Navigation011.Para_Str = "id=" + id;
            Maticsoft.BLL.SysManageBLL sm = new Maticsoft.BLL.SysManageBLL();
            SysNodeModel node             = sm.GetNode(int.Parse(id));

            this.lblID.Text      = id;
            this.txtOrderid.Text = node.OrderID.ToString();
            this.txtName.Text    = node.Text;
            //menu
            if (node.ParentID == 0)
            {
                this.listTarget.SelectedIndex = 0;
            }
            else
            {
                for (int m = 0; m < this.listTarget.Items.Count; m++)
                {
                    if (this.listTarget.Items[m].Value == node.ParentID.ToString())
                    {
                        this.listTarget.Items[m].Selected = true;
                    }
                }
            }
            this.txtUrl.Text = node.Url;
//			this.txtImgUrl.Text=node.ImageUrl;
            this.txtDescription.Text = node.Comment;

            //Permission
            for (int n = 0; n < this.listPermission.Items.Count; n++)
            {
                if ((this.listPermission.Items[n].Value == node.PermissionID.ToString()) && (this.listPermission.Items[n].Value != "-1"))
                {
                    this.listPermission.Items[n].Selected = true;
                }
            }

//			//module
//			for(int n=0;n<this.dropModule.Items.Count;n++)
//			{
//				if(this.dropModule.Items[n].Value==node.ModuleID.ToString())
//				{
//					this.dropModule.Items[n].Selected=true;
//				}
//			}
//
//			//module
//			for(int n=0;n<this.Dropdepart.Items.Count;n++)
//			{
//				if(this.Dropdepart.Items[n].Value==node.KeShiDM.ToString())
//				{
//					this.Dropdepart.Items[n].Selected=true;
//				}
//			}

            //image
            for (int n = 0; n < this.imgsel.Items.Count; n++)
            {
                if (this.imgsel.Items[n].Value == node.ImageUrl)
                {
                    this.imgsel.Items[n].Selected = true;
                    this.hideimgurl.Value         = node.ImageUrl;
                }
            }
//			if(node.KeshiPublic=="true")
//			{
//				this.chkPublic.Checked=true;
//			}
        }
Esempio n. 10
0
        protected void btnAdd_Click(object sender, System.EventArgs e)
        {
            string id      = Maticsoft.Common.PageValidate.InputText(this.lblID.Text, 10);
            string orderid = Maticsoft.Common.PageValidate.InputText(this.txtOrderid.Text, 5);
            string name    = txtName.Text;
            string url     = Maticsoft.Common.PageValidate.InputText(txtUrl.Text, 100);
//			string imgUrl=Maticsoft.Common.PageValidate.InputText(txtImgUrl.Text,100);
            string imgUrl   = this.hideimgurl.Value;
            string target   = this.listTarget.SelectedValue;
            int    parentid = int.Parse(target);

            string strErr = "";

            if (orderid.Trim() == "")
            {
                strErr += "编号不能为空\\n";
            }
            try
            {
                int.Parse(orderid);
            }
            catch
            {
                strErr += "编号格式不正确\\n";
            }
            if (name.Trim() == "")
            {
                strErr += "名称不能为空\\n";
            }

            if (this.listPermission.SelectedItem.Text.StartsWith("╋"))
            {
                strErr += "权限类别不能做权限使用\\n";
            }

            if (strErr != "")
            {
                Maticsoft.Common.MessageBox.Show(this, strErr);
                return;
            }



            int permission_id = -1;

            if (this.listPermission.SelectedIndex > 0)
            {
                permission_id = int.Parse(this.listPermission.SelectedValue);
            }
            int moduleid = -1;
//			if(this.dropModule.SelectedIndex>0)
//			{
//				moduleid=int.Parse(this.dropModule.SelectedValue);
//			}
//			int moduledeptid=-1;
//			if(this.dropModuleDept.SelectedIndex>0)
//			{
//				moduledeptid=int.Parse(this.dropModuleDept.SelectedValue);
//			}
            int keshidm = -1;
//			if(this.Dropdepart.SelectedIndex>0)
//			{
//				keshidm=int.Parse(this.Dropdepart.SelectedValue);
//			}
            string keshipublic = "false";
//			if(this.chkPublic.Checked)
//			{
//				keshipublic="true";
//			}
            string comment = Maticsoft.Common.PageValidate.InputText(txtDescription.Text, 100);

            SysNodeModel node = new SysNodeModel();

            node.NodeID       = int.Parse(id);
            node.OrderID      = int.Parse(orderid);
            node.Text         = name;
            node.ParentID     = parentid;
            node.Location     = parentid + "." + orderid;
            node.Comment      = comment;
            node.Url          = url;
            node.PermissionID = permission_id;
            node.ImageUrl     = imgUrl;
            node.ModuleID     = moduleid;
            node.KeShiDM      = keshidm;
            node.KeshiPublic  = keshipublic;

            Maticsoft.BLL.SysManageBLL sm = new Maticsoft.BLL.SysManageBLL();
            sm.UpdateNode(node);
            Response.Redirect("show.aspx?id=" + id);
        }
Esempio n. 11
0
        protected void btnAdd_Click(object sender, System.EventArgs e)
        {
            string orderid = Maticsoft.Common.PageValidate.InputText(txtId.Text, 10);
            string name    = txtName.Text;
            string url     = Maticsoft.Common.PageValidate.InputText(txtUrl.Text, 100);
            //string imgUrl=Maticsoft.Common.PageValidate.InputText(txtImgUrl.Text,100);
            string imgUrl = this.hideimgurl.Value;

            string target   = this.listTarget.SelectedValue;
            int    parentid = int.Parse(target);

            string strErr = "";

            if (orderid.Trim() == "")
            {
                strErr += "编号不能为空\\n";
            }
            try
            {
                int.Parse(orderid);
            }
            catch
            {
                strErr += "编号格式不正确\\n";
            }
            if (name.Trim() == "")
            {
                strErr += "名称不能为空\\n";
            }

            if (this.listPermission.SelectedItem.Text.StartsWith("╋"))
            {
                strErr += "权限类别不能做权限使用\\n";
            }

            if (strErr != "")
            {
                Maticsoft.Common.MessageBox.Show(this, strErr);
                return;
            }

            int permission_id = -1;

            if (this.listPermission.SelectedIndex > 0)
            {
                permission_id = int.Parse(this.listPermission.SelectedValue);
            }
            int    moduleid    = -1;
            int    keshidm     = -1;
            string keshipublic = "false";
            string comment     = Maticsoft.Common.PageValidate.InputText(txtDescription.Text, 100);

            SysNodeModel node = new SysNodeModel();

            node.Text         = name;
            node.ParentID     = parentid;
            node.Location     = parentid + "." + orderid;
            node.OrderID      = int.Parse(orderid);
            node.Comment      = comment;
            node.Url          = url;
            node.PermissionID = permission_id;
            node.ImageUrl     = imgUrl;
            node.ModuleID     = moduleid;
            node.KeShiDM      = keshidm;
            node.KeshiPublic  = keshipublic;
            Maticsoft.BLL.SysManageBLL sm = new Maticsoft.BLL.SysManageBLL();
            if (CheckBox1.Checked)
            {
                LTP.Accounts.Bus.Permissions p = new LTP.Accounts.Bus.Permissions();
                string permissionName          = node.Text;
                int    parentID = node.ParentID;
                if (parentID == 0)
                {
                    //根目录下不能选择同步创建权限
                    Maticsoft.Common.MessageBox.Show(this.Page, "根目录不能选择同步创建权限,请您手动创建!");
                    return;
                }
                SysNodeModel parentNode = new SysNodeModel();
                parentNode = sm.GetNode(parentID);
                int catalogID    = sm.GetPermissionCatalogID(parentNode.PermissionID);
                int permissionID = p.Create(catalogID, permissionName);
                node.PermissionID = permissionID;
            }
            sm.AddTreeNode(node);

            if (chkAddContinue.Checked)
            {
                Response.Redirect("Add.aspx");
            }
            else
            {
                Response.Redirect("treelist.aspx");
            }
        }
Esempio n. 12
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string id = Request.Params["id"];
                if (id == null || id.Trim() == "")
                {
                    Response.Redirect("treelist.aspx");
                    Response.End();
                }

                Navigation011.Para_Str = "id=" + id;
                Maticsoft.BLL.SysManageBLL sm = new Maticsoft.BLL.SysManageBLL();
                SysNodeModel node             = sm.GetNode(int.Parse(id));
                lblID.Text           = id;
                this.lblOrderid.Text = node.OrderID.ToString();
                lblName.Text         = node.Text;
                if (node.ParentID == 0)
                {
                    this.lblTarget.Text = "根目录";
                }
                else
                {
                    lblTarget.Text = sm.GetNode(node.ParentID).Text;
                }
                lblUrl.Text    = node.Url;
                lblImgUrl.Text = node.ImageUrl;
                LTP.Accounts.Bus.Permissions perm = new LTP.Accounts.Bus.Permissions();
                if (node.PermissionID == -1)
                {
                    this.lblPermission.Text = "没有权限限制";
                }
                else
                {
                    this.lblPermission.Text = perm.GetPermissionName(node.PermissionID);
                }

                lblDescription.Text = node.Comment;
//				if(node.ModuleID!=-1)
//				{
//					this.lblModule.Text=sm.GetModuleName(node.ModuleID);
//				}
//				else
//				{
//					this.lblModule.Text="未归属任何模块";
//				}
//
//				if(node.KeShiDM!=-1)
//				{
//					this.lblModuledept.Text=Maticsoft.BLL.PubConstant.GetKeshiName(node.KeShiDM);
//				}
//				else
//				{
//					this.lblModuledept.Text="未归属任何部门";
//				}
//				if(node.KeshiPublic=="true")
//				{
//					this.lblKeshiPublic.Text="作为部门内部公有部分出现";
//				}
            }
        }
Esempio n. 13
0
 protected void btnDelAll_Click(object sender, System.EventArgs e)
 {
     Maticsoft.BLL.SysManageBLL sm = new Maticsoft.BLL.SysManageBLL();
     sm.DeleteLog("");
     Response.Redirect("logindex.aspx");
 }