Ejemplo n.º 1
0
 private void BindList(HR_DEPT condObj)
 {
     condObj.OrderBy(HR_DEPT.Attribute.SORT_NO,Order.Asc);
     listObj = BLLTable<HR_DEPT>.Factory(conn).Select(valObj, condObj);
     repList.DataSource = listObj;
     repList.DataBind();
 }
Ejemplo n.º 2
0
    private void BindList(HR_DEPT condObj)
    {
        condObj.OrderBy(HR_DEPT.Attribute.SORT_NO, Order.Asc);
        listObj = BLLTable <HR_DEPT> .Factory(conn).Select(valObj, condObj);

        repList.DataSource = listObj;
        repList.DataBind();
    }
Ejemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            StringBuilder sb = new StringBuilder();

            if (Request["ORG_ID"] != null)
            {
                HR_DEPT objVal = new HR_DEPT();
                HR_DEPT objCond = new HR_DEPT();
                //objCond.Where("ORG_ID like '" + Request["ORG_ID"] + "%'");
                objCond.P_DEPT_ID = "0";
                objCond.ORG_ID = Request["ORG_ID"];
                moreP = "?ORG_ID=" + Request["ORG_ID"];

                objVal.OrderBy(HR_DEPT.Attribute.DEPT_ID, Order.Asc);
                List<HR_DEPT> lstChnl = BLLTable<HR_DEPT>.Factory(conn).Select(objVal, objCond);

                if (lstChnl.Count > 0)
                {
                    sb.Append("<li id=\"root_0\" data=\"{rid:'0',id:'0',pid:'0',sc:0,name:'部门选择',ntype:''}\" class=\"root\" exp='2'><div class=\"opened root\"><b></b><em></em><a href=\"#\">部门选择</a></div>");
                    sb.Append("<ul>");
                    for (int i = 0; i < lstChnl.Count; i++)
                    {
                        StringBuilder sbData = new StringBuilder();
                        string licls = "";
                        if (i == lstChnl.Count - 1)
                        {
                            licls = "last";
                        }
                        int subcount = 1;// BLLTable<HR_DEPT>.Factory(conn).Select(HR_DEPT.Attribute.P_DEPT_ID, lstChnl[i].DEPT_ID).Count;

                        if (subcount < 1)
                        {
                            if (licls != "") { licls += " "; }
                            licls += "leaf";
                        }
                        if (licls != "") { licls = " class='" + licls + "'"; }

                        sbData.Append("{rid:'0',id:'").Append(lstChnl[i].DEPT_ID.ToString());
                        sbData.Append("',pid:'").Append(lstChnl[i].P_DEPT_ID).Append("',no:").Append(lstChnl[i].DEPT_ID.ToString());
                        sbData.Append(",sc:").Append(subcount.ToString());
                        sbData.Append(",name:'").Append(lstChnl[i].DEPT_NAME).Append("',ntype:'dept'}");

                        sb.Append("<li " + licls + " id='node_" + lstChnl[i].DEPT_ID + "' data=\"" + sbData.ToString() + "\"><div><b></b><em></em><a href='#'>" + lstChnl[i].DEPT_NAME + "</a></div></li>");
                    }
                    sb.Append("</ul>");
                    sb.Append("</li>");
                }
                else
                {
                    sb.Append("<li id=\"root_0\" data=\"{rid:'0',id:'0',pid:'0',sc:0,name:'部门选择',ntype:''}\" class=\"root\"><div class='root'><b></b><em></em><a href=\"#\">部门选择</a></div></li>");

                }
            }
            else {
                HR_ORG objVal = new HR_ORG();
                HR_ORG objCond = new HR_ORG();
                objCond.P_ORG_ID = "0";
                objVal.OrderBy(HR_ORG.Attribute.SORT_NO, Order.Asc);
                List<HR_ORG> lstChnl = BLLTable<HR_ORG>.Factory(conn).Select(objVal, objCond);
                if (lstChnl.Count > 0)
                {
                    sb.Append("<li id=\"root_0\" data=\"{id:'0',pid:'0',sc:0,name:'机构部门管理',ntype:''}\" class=\"root\" exp='2'><div class=\"opened root\"><b></b><em></em><a href=\"#\">机构部门管理</a><a href='DeptManage.aspx'>刷新</a></div>");
                    sb.Append("<ul>");
                    for (int i = 0; i < lstChnl.Count; i++)
                    {
                        StringBuilder sbData = new StringBuilder();
                        string licls = "";
                        if (i == lstChnl.Count - 1)
                        {
                            licls = "last";
                        }
                        decimal subcount = 1;// lstChnl[i].SUB_NUM;
                        if (subcount == 0)
                        {
                            if (licls != "") { licls += " "; }
                            licls += "leaf";
                        }
                        if (licls != "") { licls = " class='" + licls + "'"; }

                        sbData.Append("{id:'").Append(lstChnl[i].ORG_ID.ToString());
                        sbData.Append("',pid:'").Append(lstChnl[i].P_ORG_ID).Append("',no:").Append(lstChnl[i].SORT_NO.ToString());
                        sbData.Append(",sc:").Append(subcount.ToString());
                        sbData.Append(",name:'").Append(lstChnl[i].ORG_NAME).Append("',ntype:'org'}");

                        sb.Append("<li " + licls + " id='node_" + lstChnl[i].ORG_ID + "' data=\"" + sbData.ToString() + "\"><div><b></b><em class='node_org'></em><a href='#'>" + lstChnl[i].ORG_NAME + "</a></div></li>");
                    }
                    sb.Append("</ul></li>");
                }
                else
                {
                    sb.Append("<li id=\"root_0\" data=\"{id:'0',pid:'0',sc:0,name:'机构部门管理',ntype:''}\" class=\"root\"><div class='root'><b></b><em></em><a href=\"#\">机构部门管理</a><a href='DeptManage.aspx'>刷新</a></div></li>");

                }
            }
            litChnl.Text = sb.ToString();
        }
    }
Ejemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            StringBuilder sb = new StringBuilder();


            if (Request["ORG_ID"] != null)
            {
                HR_DEPT objVal  = new HR_DEPT();
                HR_DEPT objCond = new HR_DEPT();
                //objCond.Where("ORG_ID like '" + Request["ORG_ID"] + "%'");
                objCond.P_DEPT_ID = "0";
                objCond.ORG_ID    = Request["ORG_ID"];
                moreP             = "?ORG_ID=" + Request["ORG_ID"];

                objVal.OrderBy(HR_DEPT.Attribute.DEPT_ID, Order.Asc);
                List <HR_DEPT> lstChnl = BLLTable <HR_DEPT> .Factory(conn).Select(objVal, objCond);

                if (lstChnl.Count > 0)
                {
                    sb.Append("<li id=\"root_0\" data=\"{rid:'0',id:'0',pid:'0',sc:0,name:'部门选择',ntype:''}\" class=\"root\" exp='2'><div class=\"opened root\"><b></b><em></em><a href=\"#\">部门选择</a></div>");
                    sb.Append("<ul>");
                    for (int i = 0; i < lstChnl.Count; i++)
                    {
                        StringBuilder sbData = new StringBuilder();
                        string        licls  = "";
                        if (i == lstChnl.Count - 1)
                        {
                            licls = "last";
                        }
                        int subcount = BLLTable <HR_DEPT> .Factory(conn).Select(HR_DEPT.Attribute.P_DEPT_ID, lstChnl[i].DEPT_ID).Count;

                        if (subcount < 1)
                        {
                            if (licls != "")
                            {
                                licls += " ";
                            }
                            licls += "leaf";
                        }
                        if (licls != "")
                        {
                            licls = " class='" + licls + "'";
                        }

                        sbData.Append("{rid:'0',id:'").Append(lstChnl[i].DEPT_ID.ToString());
                        sbData.Append("',pid:'").Append(lstChnl[i].P_DEPT_ID).Append("',no:'").Append(lstChnl[i].DEPT_ID.ToString());
                        sbData.Append("',sc:").Append(subcount.ToString());
                        sbData.Append(",name:'").Append(lstChnl[i].DEPT_NAME).Append("',ntype:'dept'}");

                        sb.Append("<li " + licls + " id='node_" + lstChnl[i].DEPT_ID + "' data=\"" + sbData.ToString() + "\"><div><b></b><em></em><a href='#'>" + lstChnl[i].DEPT_NAME + "</a></div></li>");
                    }
                    sb.Append("</ul>");
                    sb.Append("</li>");
                }
                else
                {
                    sb.Append("<li id=\"root_0\" data=\"{rid:'0',id:'0',pid:'0',sc:0,name:'部门选择',ntype:''}\" class=\"root\"><div class='root'><b></b><em></em><a href=\"#\">部门选择</a></div></li>");
                }
            }
            else
            {
                if (Request["P_DEPT_ID"] != null)
                {
                    HR_DEPT objVal  = new HR_DEPT();
                    HR_DEPT objCond = new HR_DEPT();
                    //objCond.Where("ORG_ID like '" + Request["ORG_ID"] + "%'");
                    objCond.P_DEPT_ID = Request["P_DEPT_ID"];

                    objVal.OrderBy(HR_DEPT.Attribute.DEPT_ID, Order.Asc);
                    List <HR_DEPT> lstChnl = BLLTable <HR_DEPT> .Factory(conn).Select(objVal, objCond);

                    sb.Append("<li id=\"root_0\" data=\"{rid:'0',id:'0',pid:'0',sc:0,name:'部门选择',ntype:''}\" class=\"root\" exp='2'><div class=\"opened root\"><b></b><em></em><a href=\"#\">部门选择</a></div>");
                    sb.Append("<ul>");
                    if (lstChnl.Count > 0)
                    {
                        for (int i = 0; i < lstChnl.Count; i++)
                        {
                            StringBuilder sbData = new StringBuilder();

                            sbData.Append("{rid:'0',id:'").Append(lstChnl[i].DEPT_ID.ToString());
                            sbData.Append("',pid:'").Append(lstChnl[i].P_DEPT_ID).Append("',no:'").Append(lstChnl[i].DEPT_ID.ToString());
                            sbData.Append("',sc:").Append("0");
                            sbData.Append(",name:'").Append(lstChnl[i].DEPT_NAME).Append("',ntype:'dept'}");

                            sb.Append("<li class= \"leaf\" id='node_" + lstChnl[i].DEPT_ID + "' data=\"" + sbData.ToString() + "\"><div><b></b><em class='node_dept'></em><a href='#'>" + lstChnl[i].DEPT_NAME + "</a></div></li>");
                        }
                    }
                    sb.Append("</ul>");
                    sb.Append("</li>");
                }
                else
                {
                    HR_ORG objVal  = new HR_ORG();
                    HR_ORG objCond = new HR_ORG();
                    objCond.P_ORG_ID = "0";
                    objVal.OrderBy(HR_ORG.Attribute.SORT_NO, Order.Asc);
                    List <HR_ORG> lstChnl = BLLTable <HR_ORG> .Factory(conn).Select(objVal, objCond);

                    if (lstChnl.Count > 0)
                    {
                        sb.Append("<li id=\"root_0\" data=\"{id:'0',pid:'0',sc:0,name:'机构部门管理',ntype:''}\" class=\"root\" exp='2'><div class=\"opened root\"><b></b><em></em><a href=\"#\">机构部门管理</a><a href='DeptManage.aspx'>刷新</a></div>");
                        sb.Append("<ul>");
                        for (int i = 0; i < lstChnl.Count; i++)
                        {
                            StringBuilder sbData = new StringBuilder();
                            string        licls  = "";
                            if (i == lstChnl.Count - 1)
                            {
                                licls = "last";
                            }
                            decimal subcount = 1;// lstChnl[i].SUB_NUM;
                            if (subcount == 0)
                            {
                                if (licls != "")
                                {
                                    licls += " ";
                                }
                                licls += "leaf";
                            }
                            if (licls != "")
                            {
                                licls = " class='" + licls + "'";
                            }

                            sbData.Append("{id:'").Append(lstChnl[i].ORG_ID.ToString());
                            sbData.Append("',pid:'").Append(lstChnl[i].P_ORG_ID).Append("',no:").Append(lstChnl[i].SORT_NO.ToString());
                            sbData.Append(",sc:").Append(subcount.ToString());
                            sbData.Append(",name:'").Append(lstChnl[i].ORG_NAME).Append("',ntype:'org'}");

                            sb.Append("<li " + licls + " id='node_" + lstChnl[i].ORG_ID + "' data=\"" + sbData.ToString() + "\"><div><b></b><em class='node_org'></em><a href='#'>" + lstChnl[i].ORG_NAME + "</a></div></li>");
                        }
                        sb.Append("</ul></li>");
                    }
                    else
                    {
                        sb.Append("<li id=\"root_0\" data=\"{id:'0',pid:'0',sc:0,name:'机构部门管理',ntype:''}\" class=\"root\"><div class='root'><b></b><em></em><a href=\"#\">机构部门管理</a><a href='DeptManage.aspx'>刷新</a></div></li>");
                    }
                }
            }
            litChnl.Text = sb.ToString();
        }
    }
Ejemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //显示子节点
            if (Request["ShowSubNodes"] != null)
            {
                string        nodetype = Request["ntype"];
                StringBuilder sb       = new StringBuilder("[");
                string        pid      = Request["id"];//orgid/deptid/taskid
                if (nodetype == "org")
                {
                    #region
                    HR_ORG obj = new HR_ORG();
                    HR_ORG val = new HR_ORG();
                    obj.P_ORG_ID = pid;

                    val.OrderBy(HR_ORG.Attribute.SORT_NO, Order.Asc);
                    List <HR_ORG> lst = BLLTable <HR_ORG> .Factory(conn).Select(val, obj);

                    if (lst != null && lst.Count > 0)
                    {
                        for (int i = 0; i < lst.Count; i++)
                        {
                            if (sb.Length > 2)
                            {
                                sb.Append(",");
                            }
                            decimal subcount = lst[i].SUB_NUM;// lst[i].SUB_NUM > 0 ? lst[i].SUB_NUM : 1;
                            sb.Append("{id:'").Append(lst[i].ORG_ID);
                            sb.Append("',pid:'").Append(lst[i].P_ORG_ID.ToString()).Append("',no:'").Append(lst[i].SORT_NO);
                            sb.Append("',sc:").Append(subcount.ToString());
                            sb.Append(",name:'").Append(lst[i].ORG_NAME).Append("',ntype:'org'}");
                        }
                    }
                    #endregion
                }
                if (nodetype == "org" || nodetype == "dept")
                {
                    #region
                    HR_DEPT obj = new HR_DEPT();
                    HR_DEPT val = new HR_DEPT();
                    if (nodetype == "org")
                    {
                        obj.ORG_ID    = pid;
                        obj.P_DEPT_ID = "0";
                    }
                    else
                    {
                        obj.P_DEPT_ID = pid;
                    }
                    val.OrderBy(HR_DEPT.Attribute.SORT_NO, Order.Asc);

                    List <HR_DEPT> lst = BLLTable <HR_DEPT> .Factory(conn).Select(val, obj);

                    if (lst.Count > 0)
                    {
                        for (int i = 0; i < lst.Count; i++)
                        {
                            if (sb.Length > 2)
                            {
                                sb.Append(",");
                            }
                            int subcount = BLLTable <HR_DEPT> .Factory(conn).Select(HR_DEPT.Attribute.P_DEPT_ID, lst[i].DEPT_ID).Count;

                            sb.Append("{rid:'").Append(lst[i].P_DEPT_ID).Append("',id:'").Append(lst[i].DEPT_ID.ToString());
                            sb.Append("',pid:'").Append(lst[i].P_DEPT_ID.ToString()).Append("',no:'").Append(lst[i].SORT_NO);
                            sb.Append("',sc:").Append(subcount.ToString());
                            sb.Append(",name:'").Append(lst[i].DEPT_NAME).Append("',ntype:'dept'}");
                        }
                    }
                    #endregion
                }
                sb.Append("]");
                Response.Write(sb.ToString());
            }
            //删除群组
            if (Request["deleteNode"] != null)
            {
                string keyid = Request["id"];
                int    re    = DeptHelper.DelDept(keyid);// BLLTable<HR_DEPT>.Factory(conn).Delete(HR_DEPT.Attribute.DEPT_ID, keyid);
                Response.Write("{re:" + re + ",msg:'删除成功'}");
            }
            //修改序号
            if (Request["UpdateSort"] != null)
            {
                string chgid1   = Request["chgid1"];
                string chgsort1 = Request["chgsort1"].ToString();
                string chgid2   = Request["chgid2"];
                string chgsort2 = Request["chgsort2"].ToString();
                try
                {
                    // int re=BllTable.UpdateCol(sys_ModuleInfo.Attribute.SortNum, chgsort1, sys_ModuleInfo.Attribute.ModuleID, chgid1, 1);
                    //re=BllTable.UpdateCol(sys_ModuleInfo.Attribute.SortNum, chgsort2, sys_ModuleInfo.Attribute.ModuleID, chgid2, 1);
                    int re = BLLTable <HR_DEPT> .Factory(conn).Update(HR_DEPT.Attribute.DEPT_ID, chgid1, HR_DEPT.Attribute.SORT_NO, chgsort1);

                    re = BLLTable <HR_DEPT> .Factory(conn).Update(HR_DEPT.Attribute.DEPT_ID, chgid2, HR_DEPT.Attribute.SORT_NO, chgsort2);

                    Response.Write(re.ToString());
                }
                catch {
                    Response.Write("0");
                }
            }

            UserBaseExd userExd = new UserBaseExd(userBase);

            //显示子节点
            if (Request["getSubNodes"] != null)
            {
                string mypaths = null;//
                if (SysSetting.TaskLog.SendTaskLimit)
                {
                    mypaths = "," + userExd.GetMyManageDeptIDS(true) + "," + userExd.GetMyDeptPathIDS() + ",";
                }
                if (Request["look"] != null)
                {
                    string user_data_ids = UserHelper.GetUserDataIDS(userBase, HR_DEPT.Attribute.DEPT_ID);
                    mypaths += user_data_ids + "," + userExd.GetMyDeptPathIDS() + ",";
                }
                if (Request["treepower"] != null)
                {
                    string user_data_ids = UserHelper.GetUserDataIDS(userBase, HR_DEPT.Attribute.DEPT_ID);
                    mypaths += user_data_ids + "," + userExd.GetMyDeptPathIDS() + ",";
                }
                if (Request["all"] != null)
                {
                    mypaths = null;
                }
                string        nodetype = Request["ntype"];
                StringBuilder sb       = new StringBuilder("[");
                string        pid      = Request["id"];//orgid/deptid/taskid
                if (nodetype == "root" || nodetype == "")
                {
                    #region
                    HR_ORG obj = new HR_ORG();
                    HR_ORG val = new HR_ORG();
                    obj.P_ORG_ID = pid;
                    val.OrderBy(HR_ORG.Attribute.SORT_NO, Order.Asc);
                    List <HR_ORG> lst = BLLTable <HR_ORG> .Factory(conn).Select(val, obj);

                    if (lst.Count != null)
                    {
                        for (int i = 0; i < lst.Count; i++)
                        {
                            if (sb.Length > 2)
                            {
                                sb.Append(",");
                            }
                            decimal subcount = lst[i].SUB_NUM > 0 ? lst[i].SUB_NUM : 1;
                            sb.Append("{id:'").Append(lst[i].ORG_ID);
                            sb.Append("',pid:'").Append(lst[i].P_ORG_ID.ToString()).Append("',no:").Append(lst[i].SORT_NO);
                            sb.Append(",sc:").Append(subcount.ToString());
                            sb.Append(",name:'").Append(lst[i].ORG_NAME).Append("',ntype:'org'}");
                        }
                    }
                    #endregion
                }
                if (nodetype == "org" || nodetype == "dept")
                {
                    #region
                    HR_DEPT objDept = new HR_DEPT();
                    HR_DEPT valDept = new HR_DEPT();
                    if (nodetype == "org")
                    {
                        objDept.ORG_ID    = pid;
                        objDept.P_DEPT_ID = "0";
                    }
                    else
                    {
                        objDept.P_DEPT_ID = pid;
                    }
                    //if (Request["my"] != null)
                    //{

                    //    mydepts += mydepts == "" ? userBase.DeptID : "," + userBase.DeptID;
                    //    objDept.In(HR_DEPT.Attribute.DEPT_ID, mydepts);
                    //}
                    valDept.OrderBy(HR_DEPT.Attribute.SORT_NO, Order.Asc);
                    List <HR_DEPT> lstDept = BLLTable <HR_DEPT> .Factory(conn).Select(valDept, objDept);

                    if (lstDept.Count != null)
                    {
                        for (int i = 0; i < lstDept.Count; i++)
                        {
                            if (mypaths == null || mypaths.IndexOf("," + lstDept[i].DEPT_ID + ",") != -1)
                            {
                                if (sb.Length > 2)
                                {
                                    sb.Append(",");
                                }
                                decimal subcount = lstDept[i].SUB_NUM > 0 ? lstDept[i].SUB_NUM : 1;
                                sb.Append("{id:'").Append(lstDept[i].DEPT_ID);
                                sb.Append("',pid:'").Append(lstDept[i].P_DEPT_ID.ToString()).Append("',no:").Append(lstDept[i].SORT_NO);
                                sb.Append(",sc:").Append(subcount.ToString());
                                sb.Append(",name:'").Append(lstDept[i].DEPT_NAME).Append("',ntype:'dept'}");
                            }
                        }
                    }
                    #endregion
                }
                sb.Append("]");
                Response.Write(sb.ToString());
            }
            Response.End();
        }
    }
Ejemplo n.º 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //��ʾ�ӽڵ�
        if (Request["ShowSubNodes"] != null)
        {
            string nodetype = Request["ntype"];
            StringBuilder sb = new StringBuilder("[");
            string pid = Request["id"];//orgid/deptid/taskid
            if (nodetype == "org")
            {

                #region
                HR_ORG obj = new HR_ORG();
                HR_ORG val = new HR_ORG();
                obj.P_ORG_ID = pid;

                val.OrderBy(HR_ORG.Attribute.SORT_NO, Order.Asc);
                List<HR_ORG> lst = BLLTable<HR_ORG>.Factory(conn).Select(val, obj);
                if (lst.Count != null)
                {
                    for (int i = 0; i < lst.Count; i++)
                    {
                        if (sb.Length > 2)
                        {
                            sb.Append(",");
                        }
                        decimal subcount = 1;// lst[i].SUB_NUM;// lst[i].SUB_NUM > 0 ? lst[i].SUB_NUM : 1;
                        sb.Append("{id:'").Append(lst[i].ORG_ID);
                        sb.Append("',pid:'").Append(lst[i].P_ORG_ID.ToString()).Append("',no:").Append(lst[i].SORT_NO);
                        sb.Append(",sc:").Append(subcount.ToString());
                        sb.Append(",name:'").Append(lst[i].ORG_NAME).Append("',ntype:'org'}");
                    }
                }
                #endregion

            }
            if (nodetype == "org" || nodetype == "dept")
            {
                #region
                HR_DEPT obj = new HR_DEPT();
                HR_DEPT val = new HR_DEPT();
                if (nodetype == "org")
                {
                    obj.ORG_ID = pid;
                    obj.P_DEPT_ID = "0";
                }
                else
                {
                    obj.P_DEPT_ID = pid;
                }
                val.OrderBy(HR_DEPT.Attribute.SORT_NO, Order.Asc);

                List<HR_DEPT> lst = BLLTable<HR_DEPT>.Factory(conn).Select(val, obj);
                if (lst.Count > 0)
                {
                    for (int i = 0; i < lst.Count; i++)
                    {
                        if (sb.Length > 2)
                        {
                            sb.Append(",");
                        }
                        int subcount = 1;// BLLTable<HR_DEPT>.Factory(conn).Select(HR_DEPT.Attribute.P_DEPT_ID, lst[i].DEPT_ID).Count;

                        sb.Append("{rid:'").Append(lst[i].P_DEPT_ID).Append("',id:'").Append(lst[i].DEPT_ID.ToString());
                        sb.Append("',pid:'").Append(lst[i].P_DEPT_ID.ToString()).Append("',no:").Append(lst[i].SORT_NO);
                        sb.Append(",sc:").Append(subcount.ToString());
                        sb.Append(",name:'").Append(lst[i].DEPT_NAME).Append("',ntype:'dept'}");

                    }

                }
                #endregion
            }
            #region
            HR_STATION objSta = new HR_STATION();
            HR_STATION valSta = new HR_STATION();
            if (nodetype == "org") {
                objSta.ORG_ID = pid;
                objSta.DEPT_ID = "0";
            }
            else if (nodetype == "dept")
            {
                objSta.DEPT_ID = pid;
            }
            else {
                objSta.PID = decimal.Parse(pid);
            }
            //objSta.P_ORG_ID = pid;

            valSta.OrderBy(HR_STATION.Attribute.SORT_NO, Order.Asc);
            List<HR_STATION> lstSta = BLLTable<HR_STATION>.Factory(conn).Select(valSta, objSta);
            if (lstSta.Count != null)
            {
                for (int i = 0; i < lstSta.Count; i++)
                {
                    if (sb.Length > 2)
                    {
                        sb.Append(",");
                    }
                    decimal subcount = lstSta[i].SUB_NUM;// lst[i].SUB_NUM > 0 ? lst[i].SUB_NUM : 1;
                    sb.Append("{id:'").Append(lstSta[i].STATION_ID);
                    sb.Append("',pid:'").Append(lstSta[i].PID.ToString()).Append("',no:").Append(lstSta[i].SORT_NO);
                    sb.Append(",sc:").Append(subcount.ToString());
                    sb.Append(",name:'").Append(lstSta[i].STATION_NAME).Append("',ntype:'station'}");
                }
            }
            #endregion

            sb.Append("]");
            Response.Write(sb.ToString());
        }

        //���б�����ɾ����ť��ͨ��AJAXִ������ĺ�̨���룬ɾ��һ����¼
        if (Request["DelSTATION_ID"] != null)
        {
            int re = delStattion(decimal.Parse(Request["DelSTATION_ID"]));// BLLTable<HR_STATION>.Factory(conn).Delete(HR_STATION.Attribute.STATION_ID, Request["DelSTATION_ID"]);
            if (re > 0)
            {
                Response.Write("1");//����������� ����0 ��ʾ�����ɹ���Ҳ����ֱ����� �ַ������ͻ��˽��������ַ�����Ϣ��Ϊ��ʾ
            }
            else
            {
                Response.Write("ɾ��ʧ�ܣ�");
            }
        }

        //���б�������ɾ����ť��ͨ��AJAXִ������ĺ�̨���룬ɾ��������¼
        if (Request["DelKeyIDS"] != null)
        {
            //HR_STATION cond = new HR_STATION();
            //cond.In(HR_STATION.Attribute.STATION_ID, Request["DelKeyIDS"]);
            int re = 0;// BLLTable<HR_STATION>.Factory(conn).Delete(cond);
            string[] arr = StringHelper.GetStringArray(Request["DelKeyIDS"], ',');
            for (int i = 0; i < arr.Length; i++) {
                re+= delStattion(decimal.Parse(arr[i]));
            }
            if (re > 0)
            {
                Response.Write("1");//����������� ����0 ��ʾ�����ɹ���Ҳ����ֱ����� �ַ������ͻ��˽��������ַ�����Ϣ��Ϊ��ʾ
            }
            else
            {
                Response.Write("ɾ��ʧ�ܣ�");
            }
        }

        //���û���ϸ��Ϣ�鿴�༭ҳ�棬�㱣��ʱ��ͨ��AJAXִ������ĺ�̨���룬ʵ�ֲ����ֶεĸ���
        if (Request["saveInfo"] != null)
        {
            HR_STATION val = new HR_STATION();
            val.STATION_ID = int.Parse(Request["FieldKeyID"]);
            List<AttributeItem> lstCol = val.af_AttributeItemList;
            for (int i = 0; i < lstCol.Count; i++)
            {
                if (!string.IsNullOrEmpty(Request["txt" + lstCol[i].FieldName])) {
                    val.SetValue(lstCol[i].FieldName,Request["txt" + lstCol[i].FieldName]);
                }
            }

            BLLTable<HR_STATION>.Factory(conn).Update(val, HR_STATION.Attribute.STATION_ID);
            Response.Write("�޸��û���Ϣ�ɹ�");

        }
        Response.End();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        title = "排班管理";
        if (Request["staffid"] != null)
        {
            idstr = "?staffid=" + Request["staffid"];
        }
        else if (Request["deptid"] != null)
        {
            idstr = "?deptid=" + Request["deptid"];
        }
        else if (Request["orgid"] != null)
        {
            idstr = "?orgid=" + Request["orgid"];
        }
        if (Request["name"] != null)
        {
            if (idstr.Contains("?"))
            {
                idstr += "&name=" + System.Uri.EscapeDataString(Request["name"]);
            }
        }
        if (!IsPostBack)
        {
            StringBuilder sb = new StringBuilder();
            //if (Request["ORG_ID"] != null)
            //{
            HR_DEPT objVal  = new HR_DEPT();
            HR_DEPT objCond = new HR_DEPT();
            //objCond.Where("ORG_ID like '" + Request["ORG_ID"] + "%'");
            //objCond.P_DEPT_ID = "0";
            //objCond.ORG_ID = Request["ORG_ID"];
            objCond.DEPT_ID = userBase.DeptID;
            moreP           = "?ORG_ID=" + Request["ORG_ID"];

            objVal.OrderBy(HR_DEPT.Attribute.DEPT_ID, Order.Asc);
            List <HR_DEPT> lstChnl = BLLTable <HR_DEPT> .Factory(conn).Select(objVal, objCond);

            if (lstChnl.Count > 0)
            {
                sb.Append("<li id=\"root_0\" data=\"{rid:'0',id:'0',pid:'0',sc:0,name:'部门选择',ntype:''}\" class=\"root\" exp='2'><div class=\"opened root\"><b></b><em></em><a href=\"#\">部门选择</a></div>");
                sb.Append("<ul>");
                for (int i = 0; i < lstChnl.Count; i++)
                {
                    StringBuilder sbData = new StringBuilder();
                    string        licls  = "";
                    if (i == lstChnl.Count - 1)
                    {
                        licls = "last";
                    }
                    int subcount = BLLTable <HR_DEPT> .Factory(conn).Select(HR_DEPT.Attribute.P_DEPT_ID, lstChnl[i].DEPT_ID).Count;

                    subcount += 10;
                    if (subcount < 1)
                    {
                        if (licls != "")
                        {
                            licls += " ";
                        }
                        licls += "leaf";
                    }
                    if (licls != "")
                    {
                        licls = " class='" + licls + "'";
                    }

                    sbData.Append("{rid:'0',id:'").Append(lstChnl[i].DEPT_ID.ToString());
                    sbData.Append("',pid:'").Append(lstChnl[i].P_DEPT_ID).Append("',no:").Append(lstChnl[i].DEPT_ID.ToString());
                    sbData.Append(",sc:").Append(subcount.ToString());
                    sbData.Append(",name:'").Append(lstChnl[i].DEPT_NAME).Append("',ntype:'dept'}");

                    sb.Append("<li " + licls + " id='node_" + lstChnl[i].DEPT_ID + "' data=\"" + sbData.ToString() + "\"><div><b></b><em></em><a href='#'>" + lstChnl[i].DEPT_NAME + "</a></div></li>");
                }
                sb.Append("</ul>");
                sb.Append("</li>");
            }
            else
            {
                sb.Append("<li id=\"root_0\" data=\"{rid:'0',id:'0',pid:'0',sc:0,name:'部门选择',ntype:''}\" class=\"root\"><div class='root'><b></b><em></em><a href=\"#\">部门选择</a></div></li>");
            }
            //}
            //else
            //{
            //    HR_ORG objVal = new HR_ORG();
            //    HR_ORG objCond = new HR_ORG();
            //    objCond.P_ORG_ID = "0";
            //    objVal.OrderBy(HR_ORG.Attribute.SORT_NO, Order.Asc);
            //    List<HR_ORG> lstChnl = BLLTable<HR_ORG>.Factory(conn).Select(objVal, objCond);
            //    if (lstChnl.Count > 0)
            //    {
            //        sb.Append("<li id=\"root_0\" data=\"{id:'0',pid:'0',sc:0,name:'机构部门管理',ntype:''}\" class=\"root\" exp='2'><div class=\"opened root\"><b></b><em></em><a href=\"#\">机构部门管理</a></div>");
            //        sb.Append("<ul>");
            //        for (int i = 0; i < lstChnl.Count; i++)
            //        {
            //            StringBuilder sbData = new StringBuilder();
            //            string licls = "";
            //            if (i == lstChnl.Count - 1)
            //            {
            //                licls = "last";
            //            }
            //            decimal subcount = 1;// lstChnl[i].SUB_NUM;
            //            if (subcount == 0)
            //            {
            //                if (licls != "") { licls += " "; }
            //                licls += "leaf";
            //            }
            //            if (licls != "") { licls = " class='" + licls + "'"; }

            //            sbData.Append("{id:'").Append(lstChnl[i].ORG_ID.ToString());
            //            sbData.Append("',pid:'").Append(lstChnl[i].P_ORG_ID).Append("',no:").Append(lstChnl[i].SORT_NO.ToString());
            //            sbData.Append(",sc:").Append(subcount.ToString());
            //            sbData.Append(",name:'").Append(lstChnl[i].ORG_NAME).Append("',ntype:'org'}");

            //            sb.Append("<li " + licls + " id='node_" + lstChnl[i].ORG_ID + "' data=\"" + sbData.ToString() + "\"><div><b></b><em class='node_org'></em><a href='#'>" + lstChnl[i].ORG_NAME + "</a></div></li>");
            //        }
            //        sb.Append("</ul></li>");
            //    }
            //    else
            //    {
            //        sb.Append("<li id=\"root_0\" data=\"{id:'0',pid:'0',sc:0,name:'机构部门管理',ntype:''}\" class=\"root\"><div class='root'><b></b><em></em><a href=\"#\">机构部门管理</a></div></li>");

            //    }
            //}
            litChnl.Text = sb.ToString();
        }
    }
Ejemplo n.º 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //显示子节点
            if (Request["ShowSubNodes"] != null)
            {
                string        nodetype = Request["ntype"];
                StringBuilder sb       = new StringBuilder("[");
                string        pid      = Request["id"];//orgid/deptid/taskid
                if (nodetype == "org")
                {
                    #region
                    HR_ORG obj = new HR_ORG();
                    HR_ORG val = new HR_ORG();
                    obj.P_ORG_ID = pid;

                    val.OrderBy(HR_ORG.Attribute.SORT_NO, Order.Asc);
                    List <HR_ORG> lst = BLLTable <HR_ORG> .Factory(conn).Select(val, obj);

                    if (lst.Count != null)
                    {
                        for (int i = 0; i < lst.Count; i++)
                        {
                            if (sb.Length > 2)
                            {
                                sb.Append(",");
                            }
                            decimal subcount = lst[i].SUB_NUM;// lst[i].SUB_NUM > 0 ? lst[i].SUB_NUM : 1;
                            sb.Append("{id:'").Append(lst[i].ORG_ID);
                            sb.Append("',pid:'").Append(lst[i].P_ORG_ID.ToString()).Append("',no:").Append(lst[i].SORT_NO);
                            sb.Append(",sc:").Append(subcount.ToString());
                            sb.Append(",name:'").Append(lst[i].ORG_NAME).Append("',ntype:'org'}");
                        }
                    }
                    #endregion
                }
                if (nodetype == "org" || nodetype == "dept")
                {
                    #region
                    HR_DEPT obj = new HR_DEPT();
                    HR_DEPT val = new HR_DEPT();
                    if (nodetype == "org")
                    {
                        obj.ORG_ID    = pid;
                        obj.P_DEPT_ID = "0";
                    }
                    else
                    {
                        obj.P_DEPT_ID = pid;
                    }
                    val.OrderBy(HR_DEPT.Attribute.SORT_NO, Order.Asc);

                    HR_STAFF stfVal = new HR_STAFF();
                    stfVal.DEPT_ID    = "";
                    stfVal.STAFF_ID   = 0;
                    stfVal.STAFF_NAME = "";
                    HR_STAFF stfCon = new HR_STAFF();
                    stfCon.DEPT_ID = obj.P_DEPT_ID;
                    List <HR_STAFF> stflst = BLLTable <HR_STAFF> .Factory(conn).Select(stfVal, stfCon);

                    if (stflst.Count > 0)
                    {
                        for (int i = 0; i < stflst.Count; i++)
                        {
                            if (sb.Length > 2)
                            {
                                sb.Append(",");
                            }
                            sb.Append("{rid:'").Append(stflst[i].DEPT_ID).Append("',id:'").Append(stflst[i].STAFF_ID.ToString());
                            sb.Append("',pid:'").Append(stflst[i].DEPT_ID.ToString()).Append("',no:").Append(stflst[i].STAFF_ID);
                            sb.Append(",sc:").Append("0");
                            sb.Append(",name:'").Append(stflst[i].STAFF_NAME.Replace("?粀", "").Replace("\0", "").Replace("?", "").Replace("粀", "")).Append("',ntype:'man'}");
                        }
                    }

                    List <HR_DEPT> lst = BLLTable <HR_DEPT> .Factory(conn).Select(val, obj);

                    if (lst.Count > 0)
                    {
                        for (int i = 0; i < lst.Count; i++)
                        {
                            if (sb.Length > 2)
                            {
                                sb.Append(",");
                            }
                            int subcount = BLLTable <HR_DEPT> .Factory(conn).Select(HR_DEPT.Attribute.P_DEPT_ID, lst[i].DEPT_ID).Count;

                            subcount += BLLTable <HR_STAFF> .Factory(conn).Select(HR_STAFF.Attribute.DEPT_ID, lst[i].DEPT_ID).Count;

                            sb.Append("{rid:'").Append(lst[i].P_DEPT_ID).Append("',id:'").Append(lst[i].DEPT_ID.ToString());
                            sb.Append("',pid:'").Append(lst[i].P_DEPT_ID.ToString()).Append("',no:").Append(lst[i].SORT_NO);
                            sb.Append(",sc:").Append(subcount.ToString());
                            sb.Append(",name:'").Append(lst[i].DEPT_NAME).Append("',ntype:'dept'}");
                        }
                    }
                    #endregion
                }
                sb.Append("]");
                Response.Write(sb.ToString());
            }
            Response.End();
        }
    }
Ejemplo n.º 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //显示子节点
            if (Request["ShowSubNodes"] != null)
            {
                string        nodetype = Request["ntype"];
                StringBuilder sb       = new StringBuilder("[");
                string        pid      = Request["id"];//orgid/deptid/taskid
                if (nodetype == "org")
                {
                    #region
                    HR_ORG obj = new HR_ORG();
                    HR_ORG val = new HR_ORG();
                    obj.P_ORG_ID = pid;

                    val.OrderBy(HR_ORG.Attribute.SORT_NO, Order.Asc);
                    List <HR_ORG> lst = BLLTable <HR_ORG> .Factory(conn).Select(val, obj);

                    if (lst.Count != null)
                    {
                        for (int i = 0; i < lst.Count; i++)
                        {
                            if (sb.Length > 2)
                            {
                                sb.Append(",");
                            }
                            decimal subcount = lst[i].SUB_NUM;// lst[i].SUB_NUM > 0 ? lst[i].SUB_NUM : 1;
                            sb.Append("{id:'").Append(lst[i].ORG_ID);
                            sb.Append("',pid:'").Append(lst[i].P_ORG_ID.ToString()).Append("',no:'").Append(lst[i].SORT_NO);
                            sb.Append("',sc:").Append(subcount.ToString());
                            sb.Append(",name:'").Append(lst[i].ORG_NAME).Append("',ntype:'org'}");
                        }
                    }
                    #endregion
                }
                if (nodetype == "org" || nodetype == "dept")
                {
                    #region
                    HR_DEPT obj = new HR_DEPT();
                    HR_DEPT val = new HR_DEPT();
                    if (nodetype == "org")
                    {
                        obj.ORG_ID    = pid;
                        obj.P_DEPT_ID = "0";
                    }
                    else
                    {
                        obj.P_DEPT_ID = pid;
                    }
                    val.OrderBy(HR_DEPT.Attribute.SORT_NO, Order.Asc);

                    List <HR_DEPT> lst = BLLTable <HR_DEPT> .Factory(conn).Select(val, obj);

                    if (lst.Count > 0)
                    {
                        for (int i = 0; i < lst.Count; i++)
                        {
                            if (sb.Length > 2)
                            {
                                sb.Append(",");
                            }
                            int subcount = BLLTable <HR_DEPT> .Factory(conn).Select(HR_DEPT.Attribute.P_DEPT_ID, lst[i].DEPT_ID).Count;

                            sb.Append("{rid:'").Append(lst[i].P_DEPT_ID).Append("',id:'").Append(lst[i].DEPT_ID.ToString());
                            sb.Append("',pid:'").Append(lst[i].P_DEPT_ID.ToString()).Append("',no:'").Append(lst[i].SORT_NO);
                            sb.Append("',sc:").Append(subcount.ToString());
                            sb.Append(",name:'").Append(lst[i].DEPT_NAME).Append("',ntype:'dept'}");
                        }
                    }
                    #endregion
                }
                sb.Append("]");
                Response.Write(sb.ToString());
            }
            //删除群组
            if (Request["DelNodeID"] != null)
            {
                string keyid = Request["id"];
                int    re    = DeptHelper.DelDept(keyid);// BLLTable<HR_DEPT>.Factory(conn).Delete(HR_DEPT.Attribute.DEPT_ID, keyid);
                Response.Write(re.ToString());
            }
            //修改序号
            if (Request["UpdateSort"] != null)
            {
                string chgid1   = Request["chgid1"];
                string chgsort1 = Request["chgsort1"].ToString();
                string chgid2   = Request["chgid2"];
                string chgsort2 = Request["chgsort2"].ToString();
                try
                {
                    // int re=BllTable.UpdateCol(sys_ModuleInfo.Attribute.SortNum, chgsort1, sys_ModuleInfo.Attribute.ModuleID, chgid1, 1);
                    //re=BllTable.UpdateCol(sys_ModuleInfo.Attribute.SortNum, chgsort2, sys_ModuleInfo.Attribute.ModuleID, chgid2, 1);
                    int re = BLLTable <HR_DEPT> .Factory(conn).Update(HR_DEPT.Attribute.DEPT_ID, chgid1, HR_DEPT.Attribute.SORT_NO, chgsort1);

                    re = BLLTable <HR_DEPT> .Factory(conn).Update(HR_DEPT.Attribute.DEPT_ID, chgid2, HR_DEPT.Attribute.SORT_NO, chgsort2);

                    Response.Write(re.ToString());
                }
                catch {
                    Response.Write("0");
                }
            }

            Response.End();
        }
    }
Ejemplo n.º 10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //显示子节点
        if (Request["ShowSubNodes"] != null)
        {
            string        nodetype = Request["ntype"];
            StringBuilder sb       = new StringBuilder("[");
            string        pid      = Request["id"];//orgid/deptid/taskid
            if (nodetype == "org")
            {
                #region
                HR_ORG obj = new HR_ORG();
                HR_ORG val = new HR_ORG();
                obj.P_ORG_ID = pid;

                val.OrderBy(HR_ORG.Attribute.SORT_NO, Order.Asc);
                List <HR_ORG> lst = BLLTable <HR_ORG> .Factory(conn).Select(val, obj);

                if (lst.Count != null)
                {
                    for (int i = 0; i < lst.Count; i++)
                    {
                        if (sb.Length > 2)
                        {
                            sb.Append(",");
                        }
                        decimal subcount = 1;// lst[i].SUB_NUM;// lst[i].SUB_NUM > 0 ? lst[i].SUB_NUM : 1;
                        sb.Append("{id:'").Append(lst[i].ORG_ID);
                        sb.Append("',pid:'").Append(lst[i].P_ORG_ID.ToString()).Append("',no:").Append(lst[i].SORT_NO);
                        sb.Append(",sc:").Append(subcount.ToString());
                        sb.Append(",name:'").Append(lst[i].ORG_NAME).Append("',ntype:'org'}");
                    }
                }
                #endregion
            }
            if (nodetype == "org" || nodetype == "dept")
            {
                #region
                HR_DEPT obj = new HR_DEPT();
                HR_DEPT val = new HR_DEPT();
                if (nodetype == "org")
                {
                    obj.ORG_ID    = pid;
                    obj.P_DEPT_ID = "0";
                }
                else
                {
                    obj.P_DEPT_ID = pid;
                }
                val.OrderBy(HR_DEPT.Attribute.SORT_NO, Order.Asc);

                List <HR_DEPT> lst = BLLTable <HR_DEPT> .Factory(conn).Select(val, obj);

                if (lst.Count > 0)
                {
                    for (int i = 0; i < lst.Count; i++)
                    {
                        if (sb.Length > 2)
                        {
                            sb.Append(",");
                        }
                        int subcount = 1;// BLLTable<HR_DEPT>.Factory(conn).Select(HR_DEPT.Attribute.P_DEPT_ID, lst[i].DEPT_ID).Count;

                        sb.Append("{rid:'").Append(lst[i].P_DEPT_ID).Append("',id:'").Append(lst[i].DEPT_ID.ToString());
                        sb.Append("',pid:'").Append(lst[i].P_DEPT_ID.ToString()).Append("',no:").Append(lst[i].SORT_NO);
                        sb.Append(",sc:").Append(subcount.ToString());
                        sb.Append(",name:'").Append(lst[i].DEPT_NAME).Append("',ntype:'dept'}");
                    }
                }
                #endregion
            }
            #region
            HR_STATION objSta = new HR_STATION();
            HR_STATION valSta = new HR_STATION();
            if (nodetype == "org")
            {
                objSta.ORG_ID  = pid;
                objSta.DEPT_ID = "0";
            }
            else if (nodetype == "dept")
            {
                objSta.DEPT_ID = pid;
            }
            else
            {
                objSta.PID = decimal.Parse(pid);
            }
            //objSta.P_ORG_ID = pid;

            valSta.OrderBy(HR_STATION.Attribute.SORT_NO, Order.Asc);
            List <HR_STATION> lstSta = BLLTable <HR_STATION> .Factory(conn).Select(valSta, objSta);

            if (lstSta.Count != null)
            {
                for (int i = 0; i < lstSta.Count; i++)
                {
                    if (sb.Length > 2)
                    {
                        sb.Append(",");
                    }
                    decimal subcount = lstSta[i].SUB_NUM;// lst[i].SUB_NUM > 0 ? lst[i].SUB_NUM : 1;
                    sb.Append("{id:'").Append(lstSta[i].STATION_ID);
                    sb.Append("',pid:'").Append(lstSta[i].PID.ToString()).Append("',no:").Append(lstSta[i].SORT_NO);
                    sb.Append(",sc:").Append(subcount.ToString());
                    sb.Append(",name:'").Append(lstSta[i].STATION_NAME).Append("',ntype:'station'}");
                }
            }
            #endregion

            sb.Append("]");
            Response.Write(sb.ToString());
        }

        //在列表里点击删除按钮,通过AJAX执行这里的后台代码,删除一条记录
        if (Request["DelSTATION_ID"] != null)
        {
            int re = delStattion(decimal.Parse(Request["DelSTATION_ID"]));// BLLTable<HR_STATION>.Factory(conn).Delete(HR_STATION.Attribute.STATION_ID, Request["DelSTATION_ID"]);
            if (re > 0)
            {
                Response.Write("1");//可以输出数字 大于0 表示操作成功,也可以直接输出 字符串,客户端将弹出此字符串信息作为提示
            }
            else
            {
                Response.Write("删除失败!");
            }
        }

        //在列表顶部点击删除按钮,通过AJAX执行这里的后台代码,删除多条记录
        if (Request["DelKeyIDS"] != null)
        {
            //HR_STATION cond = new HR_STATION();
            //cond.In(HR_STATION.Attribute.STATION_ID, Request["DelKeyIDS"]);
            int      re  = 0;// BLLTable<HR_STATION>.Factory(conn).Delete(cond);
            string[] arr = StringHelper.GetStringArray(Request["DelKeyIDS"], ',');
            for (int i = 0; i < arr.Length; i++)
            {
                re += delStattion(decimal.Parse(arr[i]));
            }
            if (re > 0)
            {
                Response.Write("1");//可以输出数字 大于0 表示操作成功,也可以直接输出 字符串,客户端将弹出此字符串信息作为提示
            }
            else
            {
                Response.Write("删除失败!");
            }
        }

        //在用户详细信息查看编辑页面,点保存时,通过AJAX执行这里的后台代码,实现部门字段的更新
        if (Request["saveInfo"] != null)
        {
            HR_STATION val = new HR_STATION();
            val.STATION_ID = int.Parse(Request["FieldKeyID"]);
            List <AttributeItem> lstCol = val.af_AttributeItemList;
            for (int i = 0; i < lstCol.Count; i++)
            {
                if (!string.IsNullOrEmpty(Request["txt" + lstCol[i].FieldName]))
                {
                    val.SetValue(lstCol[i].FieldName, Request["txt" + lstCol[i].FieldName]);
                }
            }

            BLLTable <HR_STATION> .Factory(conn).Update(val, HR_STATION.Attribute.STATION_ID);

            Response.Write("修改用户信息成功");
        }
        Response.End();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        title = "排班管理";
        if (Request["staffid"] != null)
        {
            idstr = "?staffid=" + Request["staffid"];
        }
        else if (Request["deptid"] != null)
        {
            idstr = "?deptid=" + Request["deptid"];
        }
        else if (Request["orgid"] != null)
        {
            idstr = "?orgid=" + Request["orgid"];
        }
        if (Request["name"] != null)
        {
            if (idstr.Contains("?"))
                idstr += "&name=" + System.Uri.EscapeDataString(Request["name"]);
        }
        if (!IsPostBack)
        {
            StringBuilder sb = new StringBuilder();
            //if (Request["ORG_ID"] != null)
            //{
                HR_DEPT objVal = new HR_DEPT();
                HR_DEPT objCond = new HR_DEPT();
                //objCond.Where("ORG_ID like '" + Request["ORG_ID"] + "%'");
                //objCond.P_DEPT_ID = "0";
                //objCond.ORG_ID = Request["ORG_ID"];
                objCond.DEPT_ID = userBase.DeptID;
                moreP = "?ORG_ID=" + Request["ORG_ID"];

                objVal.OrderBy(HR_DEPT.Attribute.DEPT_ID, Order.Asc);
                List<HR_DEPT> lstChnl = BLLTable<HR_DEPT>.Factory(conn).Select(objVal, objCond);

                if (lstChnl.Count > 0)
                {
                    sb.Append("<li id=\"root_0\" data=\"{rid:'0',id:'0',pid:'0',sc:0,name:'部门选择',ntype:''}\" class=\"root\" exp='2'><div class=\"opened root\"><b></b><em></em><a href=\"#\">部门选择</a></div>");
                    sb.Append("<ul>");
                    for (int i = 0; i < lstChnl.Count; i++)
                    {
                        StringBuilder sbData = new StringBuilder();
                        string licls = "";
                        if (i == lstChnl.Count - 1)
                        {
                            licls = "last";
                        }
                        int subcount = BLLTable<HR_DEPT>.Factory(conn).Select(HR_DEPT.Attribute.P_DEPT_ID, lstChnl[i].DEPT_ID).Count;
                        subcount += 10;
                        if (subcount < 1)
                        {
                            if (licls != "") { licls += " "; }
                            licls += "leaf";
                        }
                        if (licls != "") { licls = " class='" + licls + "'"; }

                        sbData.Append("{rid:'0',id:'").Append(lstChnl[i].DEPT_ID.ToString());
                        sbData.Append("',pid:'").Append(lstChnl[i].P_DEPT_ID).Append("',no:").Append(lstChnl[i].DEPT_ID.ToString());
                        sbData.Append(",sc:").Append(subcount.ToString());
                        sbData.Append(",name:'").Append(lstChnl[i].DEPT_NAME).Append("',ntype:'dept'}");

                        sb.Append("<li " + licls + " id='node_" + lstChnl[i].DEPT_ID + "' data=\"" + sbData.ToString() + "\"><div><b></b><em></em><a href='#'>" + lstChnl[i].DEPT_NAME + "</a></div></li>");
                    }
                    sb.Append("</ul>");
                    sb.Append("</li>");
                }
                else
                {
                    sb.Append("<li id=\"root_0\" data=\"{rid:'0',id:'0',pid:'0',sc:0,name:'部门选择',ntype:''}\" class=\"root\"><div class='root'><b></b><em></em><a href=\"#\">部门选择</a></div></li>");

                }
            //}
            //else
            //{
            //    HR_ORG objVal = new HR_ORG();
            //    HR_ORG objCond = new HR_ORG();
            //    objCond.P_ORG_ID = "0";
            //    objVal.OrderBy(HR_ORG.Attribute.SORT_NO, Order.Asc);
            //    List<HR_ORG> lstChnl = BLLTable<HR_ORG>.Factory(conn).Select(objVal, objCond);
            //    if (lstChnl.Count > 0)
            //    {
            //        sb.Append("<li id=\"root_0\" data=\"{id:'0',pid:'0',sc:0,name:'机构部门管理',ntype:''}\" class=\"root\" exp='2'><div class=\"opened root\"><b></b><em></em><a href=\"#\">机构部门管理</a></div>");
            //        sb.Append("<ul>");
            //        for (int i = 0; i < lstChnl.Count; i++)
            //        {
            //            StringBuilder sbData = new StringBuilder();
            //            string licls = "";
            //            if (i == lstChnl.Count - 1)
            //            {
            //                licls = "last";
            //            }
            //            decimal subcount = 1;// lstChnl[i].SUB_NUM;
            //            if (subcount == 0)
            //            {
            //                if (licls != "") { licls += " "; }
            //                licls += "leaf";
            //            }
            //            if (licls != "") { licls = " class='" + licls + "'"; }

            //            sbData.Append("{id:'").Append(lstChnl[i].ORG_ID.ToString());
            //            sbData.Append("',pid:'").Append(lstChnl[i].P_ORG_ID).Append("',no:").Append(lstChnl[i].SORT_NO.ToString());
            //            sbData.Append(",sc:").Append(subcount.ToString());
            //            sbData.Append(",name:'").Append(lstChnl[i].ORG_NAME).Append("',ntype:'org'}");

            //            sb.Append("<li " + licls + " id='node_" + lstChnl[i].ORG_ID + "' data=\"" + sbData.ToString() + "\"><div><b></b><em class='node_org'></em><a href='#'>" + lstChnl[i].ORG_NAME + "</a></div></li>");
            //        }
            //        sb.Append("</ul></li>");
            //    }
            //    else
            //    {
            //        sb.Append("<li id=\"root_0\" data=\"{id:'0',pid:'0',sc:0,name:'机构部门管理',ntype:''}\" class=\"root\"><div class='root'><b></b><em></em><a href=\"#\">机构部门管理</a></div></li>");

            //    }
            //}
            litChnl.Text = sb.ToString();
        }
    }
Ejemplo n.º 12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //显示子节点
            if (Request["ShowSubNodes"] != null)
            {
                string nodetype = Request["ntype"];
                StringBuilder sb = new StringBuilder("[");
                string pid = Request["id"];//orgid/deptid/taskid
                if (nodetype == "org")
                {
                    #region
                    HR_ORG obj = new HR_ORG();
                    HR_ORG val = new HR_ORG();
                    obj.P_ORG_ID = pid;

                    val.OrderBy(HR_ORG.Attribute.SORT_NO, Order.Asc);
                    List<HR_ORG> lst = BLLTable<HR_ORG>.Factory(conn).Select(val, obj);
                    if (lst.Count!=null)
                    {
                        for (int i = 0; i < lst.Count; i++)
                        {
                            if (sb.Length > 2)
                            {
                                sb.Append(",");
                            }
                            decimal subcount = lst[i].SUB_NUM;// lst[i].SUB_NUM > 0 ? lst[i].SUB_NUM : 1;
                            sb.Append("{id:'").Append(lst[i].ORG_ID);
                            sb.Append("',pid:'").Append(lst[i].P_ORG_ID.ToString()).Append("',no:").Append(lst[i].SORT_NO);
                            sb.Append(",sc:").Append(subcount.ToString());
                            sb.Append(",name:'").Append(lst[i].ORG_NAME).Append("',ntype:'org'}");
                        }
                    }
                    #endregion
                }
                if (nodetype == "org" || nodetype == "dept")
                {
                    #region
                    HR_DEPT obj = new HR_DEPT();
                    HR_DEPT val = new HR_DEPT();
                    if (nodetype == "org") {
                        obj.ORG_ID = pid;
                        obj.P_DEPT_ID = "0";
                    }
                    else {
                        obj.P_DEPT_ID = pid;
                    }
                    val.OrderBy(HR_DEPT.Attribute.SORT_NO, Order.Asc);

                    HR_STAFF stfVal = new HR_STAFF();
                    stfVal.DEPT_ID = "";
                    stfVal.STAFF_ID = 0;
                    stfVal.STAFF_NAME = "";
                    HR_STAFF stfCon = new HR_STAFF();
                    stfCon.DEPT_ID = obj.P_DEPT_ID;
                    List<HR_STAFF> stflst = BLLTable<HR_STAFF>.Factory(conn).Select(stfVal, stfCon);
                    if (stflst.Count > 0)
                    {
                        for (int i = 0; i < stflst.Count; i++)
                        {
                            if (sb.Length > 2)
                            {
                                sb.Append(",");
                            }
                            sb.Append("{rid:'").Append(stflst[i].DEPT_ID).Append("',id:'").Append(stflst[i].STAFF_ID.ToString());
                            sb.Append("',pid:'").Append(stflst[i].DEPT_ID.ToString()).Append("',no:").Append(stflst[i].STAFF_ID);
                            sb.Append(",sc:").Append("0");
                            sb.Append(",name:'").Append(stflst[i].STAFF_NAME.Replace("?粀", "").Replace("\0", "").Replace("?", "").Replace("粀", "")).Append("',ntype:'man'}");

                        }

                    }

                    List<HR_DEPT> lst = BLLTable<HR_DEPT>.Factory(conn).Select(val, obj);
                    if (lst.Count > 0)
                    {
                        for (int i = 0; i < lst.Count; i++)
                        {
                            if (sb.Length > 2)
                            {
                                sb.Append(",");
                            }
                            int subcount = BLLTable<HR_DEPT>.Factory(conn).Select(HR_DEPT.Attribute.P_DEPT_ID, lst[i].DEPT_ID).Count;
                            subcount += BLLTable<HR_STAFF>.Factory(conn).Select(HR_STAFF.Attribute.DEPT_ID, lst[i].DEPT_ID).Count;

                            sb.Append("{rid:'").Append(lst[i].P_DEPT_ID).Append("',id:'").Append(lst[i].DEPT_ID.ToString());
                            sb.Append("',pid:'").Append(lst[i].P_DEPT_ID.ToString()).Append("',no:").Append(lst[i].SORT_NO);
                            sb.Append(",sc:").Append(subcount.ToString());
                            sb.Append(",name:'").Append(lst[i].DEPT_NAME).Append("',ntype:'dept'}");

                        }

                    }
                    #endregion
                }
                sb.Append("]");
                Response.Write(sb.ToString());
            }
            Response.End();
        }
    }
Ejemplo n.º 13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //显示子节点
            if (Request["ShowSubNodes"] != null)
            {
                string nodetype = Request["ntype"];
                StringBuilder sb = new StringBuilder("[");
                string pid = Request["id"];//orgid/deptid/taskid
                if (nodetype == "org")
                {
                    #region
                    HR_ORG obj = new HR_ORG();
                    HR_ORG val = new HR_ORG();
                    obj.P_ORG_ID = pid;

                    val.OrderBy(HR_ORG.Attribute.SORT_NO, Order.Asc);
                    List<HR_ORG> lst = BLLTable<HR_ORG>.Factory(conn).Select(val, obj);
                    if (lst.Count!=null)
                    {
                        for (int i = 0; i < lst.Count; i++)
                        {
                            if (sb.Length > 2)
                            {
                                sb.Append(",");
                            }
                            decimal subcount = lst[i].SUB_NUM;// lst[i].SUB_NUM > 0 ? lst[i].SUB_NUM : 1;
                            sb.Append("{id:'").Append(lst[i].ORG_ID);
                            sb.Append("',pid:'").Append(lst[i].P_ORG_ID.ToString()).Append("',no:'").Append(lst[i].SORT_NO);
                            sb.Append("',sc:").Append(subcount.ToString());
                            sb.Append(",name:'").Append(lst[i].ORG_NAME).Append("',ntype:'org'}");
                        }
                    }
                    #endregion
                }
                if (nodetype == "org" || nodetype == "dept")
                {
                    #region
                    HR_DEPT obj = new HR_DEPT();
                    HR_DEPT val = new HR_DEPT();
                    if (nodetype == "org") {
                        obj.ORG_ID = pid;
                        obj.P_DEPT_ID = "0";
                    }
                    else {
                        obj.P_DEPT_ID = pid;
                    }
                    val.OrderBy(HR_DEPT.Attribute.SORT_NO, Order.Asc);

                    List<HR_DEPT> lst = BLLTable<HR_DEPT>.Factory(conn).Select(val, obj);
                    if (lst.Count > 0)
                    {
                        for (int i = 0; i < lst.Count; i++)
                        {
                            if (sb.Length > 2)
                            {
                                sb.Append(",");
                            }
                            int subcount = BLLTable<HR_DEPT>.Factory(conn).Select(HR_DEPT.Attribute.P_DEPT_ID, lst[i].DEPT_ID).Count;

                            sb.Append("{rid:'").Append(lst[i].P_DEPT_ID).Append("',id:'").Append(lst[i].DEPT_ID.ToString());
                            sb.Append("',pid:'").Append(lst[i].P_DEPT_ID.ToString()).Append("',no:'").Append(lst[i].SORT_NO);
                            sb.Append("',sc:").Append(subcount.ToString());
                            sb.Append(",name:'").Append(lst[i].DEPT_NAME).Append("',ntype:'dept'}");

                        }
                    }
                    #endregion
                }
                sb.Append("]");
                Response.Write(sb.ToString());
            }
            //删除群组
            if (Request["DelNodeID"] != null)
            {
                string keyid = Request["id"];
                int re = DeptHelper.DelDept(keyid);// BLLTable<HR_DEPT>.Factory(conn).Delete(HR_DEPT.Attribute.DEPT_ID, keyid);
                Response.Write(re.ToString());
            }
            //修改序号
            if (Request["UpdateSort"] != null)
            {
                string chgid1 = Request["chgid1"];
                string chgsort1 = Request["chgsort1"].ToString();
                string chgid2 = Request["chgid2"];
                string chgsort2 = Request["chgsort2"].ToString();
                try
                {
                   // int re=BllTable.UpdateCol(sys_ModuleInfo.Attribute.SortNum, chgsort1, sys_ModuleInfo.Attribute.ModuleID, chgid1, 1);
                    //re=BllTable.UpdateCol(sys_ModuleInfo.Attribute.SortNum, chgsort2, sys_ModuleInfo.Attribute.ModuleID, chgid2, 1);
                    int re = BLLTable<HR_DEPT>.Factory(conn).Update(HR_DEPT.Attribute.DEPT_ID, chgid1, HR_DEPT.Attribute.SORT_NO, chgsort1);
                    re = BLLTable<HR_DEPT>.Factory(conn).Update(HR_DEPT.Attribute.DEPT_ID, chgid2, HR_DEPT.Attribute.SORT_NO, chgsort2);

                    Response.Write(re.ToString());
                }
                catch {
                    Response.Write("0");
                }

            }

            Response.End();
        }
    }
Ejemplo n.º 14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //显示子节点
            if (Request["ShowSubNodes"] != null)
            {
                string nodetype = Request["ntype"];
                StringBuilder sb = new StringBuilder("[");
                string pid = Request["id"];//orgid/deptid/taskid
                if (nodetype == "org")
                {

                    #region
                    HR_ORG obj = new HR_ORG();
                    HR_ORG val = new HR_ORG();
                    obj.P_ORG_ID = pid;

                    val.OrderBy(HR_ORG.Attribute.SORT_NO, Order.Asc);
                    List<HR_ORG> lst = BLLTable<HR_ORG>.Factory(conn).Select(val, obj);
                    if (lst != null && lst.Count > 0)
                    {
                        for (int i = 0; i < lst.Count; i++)
                        {
                            if (sb.Length > 2)
                            {
                                sb.Append(",");
                            }
                            decimal subcount = lst[i].SUB_NUM;// lst[i].SUB_NUM > 0 ? lst[i].SUB_NUM : 1;
                            sb.Append("{id:'").Append(lst[i].ORG_ID);
                            sb.Append("',pid:'").Append(lst[i].P_ORG_ID.ToString()).Append("',no:'").Append(lst[i].SORT_NO);
                            sb.Append("',sc:").Append(subcount.ToString());
                            sb.Append(",name:'").Append(lst[i].ORG_NAME).Append("',ntype:'org'}");
                        }
                    }
                    #endregion
                }
                if (nodetype == "org" || nodetype == "dept")
                {
                    #region
                    HR_DEPT obj = new HR_DEPT();
                    HR_DEPT val = new HR_DEPT();
                    if (nodetype == "org") {
                        obj.ORG_ID = pid;
                        obj.P_DEPT_ID = "0";
                    }
                    else {
                        obj.P_DEPT_ID = pid;
                    }
                    val.OrderBy(HR_DEPT.Attribute.SORT_NO, Order.Asc);

                    List<HR_DEPT> lst = BLLTable<HR_DEPT>.Factory(conn).Select(val, obj);
                    if (lst.Count > 0)
                    {
                        for (int i = 0; i < lst.Count; i++)
                        {
                            if (sb.Length > 2)
                            {
                                sb.Append(",");
                            }
                            int subcount = BLLTable<HR_DEPT>.Factory(conn).Select(HR_DEPT.Attribute.P_DEPT_ID, lst[i].DEPT_ID).Count;

                            sb.Append("{rid:'").Append(lst[i].P_DEPT_ID).Append("',id:'").Append(lst[i].DEPT_ID.ToString());
                            sb.Append("',pid:'").Append(lst[i].P_DEPT_ID.ToString()).Append("',no:'").Append(lst[i].SORT_NO);
                            sb.Append("',sc:").Append(subcount.ToString());
                            sb.Append(",name:'").Append(lst[i].DEPT_NAME).Append("',ntype:'dept'}");

                        }

                    }
                    #endregion
                }
                sb.Append("]");
                Response.Write(sb.ToString());
            }
            //删除群组
            if (Request["deleteNode"] != null)
            {
                string keyid = Request["id"];
                int re = DeptHelper.DelDept(keyid);// BLLTable<HR_DEPT>.Factory(conn).Delete(HR_DEPT.Attribute.DEPT_ID, keyid);
                Response.Write("{re:" + re + ",msg:'删除成功'}");
            }
            //修改序号
            if (Request["UpdateSort"] != null)
            {
                string chgid1 = Request["chgid1"];
                string chgsort1 = Request["chgsort1"].ToString();
                string chgid2 = Request["chgid2"];
                string chgsort2 = Request["chgsort2"].ToString();
                try
                {
                   // int re=BllTable.UpdateCol(sys_ModuleInfo.Attribute.SortNum, chgsort1, sys_ModuleInfo.Attribute.ModuleID, chgid1, 1);
                    //re=BllTable.UpdateCol(sys_ModuleInfo.Attribute.SortNum, chgsort2, sys_ModuleInfo.Attribute.ModuleID, chgid2, 1);
                    int re = BLLTable<HR_DEPT>.Factory(conn).Update(HR_DEPT.Attribute.DEPT_ID, chgid1, HR_DEPT.Attribute.SORT_NO, chgsort1);
                    re = BLLTable<HR_DEPT>.Factory(conn).Update(HR_DEPT.Attribute.DEPT_ID, chgid2, HR_DEPT.Attribute.SORT_NO, chgsort2);

                    Response.Write(re.ToString());
                }
                catch {
                    Response.Write("0");
                }

            }

            UserBaseExd userExd = new UserBaseExd(userBase);

            //显示子节点
            if (Request["getSubNodes"] != null)
            {
                string mypaths = null;//
                if (SysSetting.TaskLog.SendTaskLimit)
                {
                    mypaths = "," + userExd.GetMyManageDeptIDS(true) + "," + userExd.GetMyDeptPathIDS() + ",";
                }
                if (Request["look"] != null)
                {
                    string user_data_ids = UserHelper.GetUserDataIDS(userBase, HR_DEPT.Attribute.DEPT_ID);
                    mypaths += user_data_ids + "," + userExd.GetMyDeptPathIDS() + ",";
                }
                if (Request["treepower"] != null)
                {
                    string user_data_ids = UserHelper.GetUserDataIDS(userBase, HR_DEPT.Attribute.DEPT_ID);
                    mypaths += user_data_ids + "," + userExd.GetMyDeptPathIDS() + ",";
                }
                if (Request["all"] != null)
                {
                    mypaths = null;
                }
                string nodetype = Request["ntype"];
                StringBuilder sb = new StringBuilder("[");
                string pid = Request["id"];//orgid/deptid/taskid
                if (nodetype == "root" || nodetype == "")
                {
                    #region
                    HR_ORG obj = new HR_ORG();
                    HR_ORG val = new HR_ORG();
                    obj.P_ORG_ID = pid;
                    val.OrderBy(HR_ORG.Attribute.SORT_NO, Order.Asc);
                    List<HR_ORG> lst = BLLTable<HR_ORG>.Factory(conn).Select(val, obj);
                    if (lst.Count != null)
                    {
                        for (int i = 0; i < lst.Count; i++)
                        {
                            if (sb.Length > 2)
                            {
                                sb.Append(",");
                            }
                            decimal subcount = lst[i].SUB_NUM > 0 ? lst[i].SUB_NUM : 1;
                            sb.Append("{id:'").Append(lst[i].ORG_ID);
                            sb.Append("',pid:'").Append(lst[i].P_ORG_ID.ToString()).Append("',no:").Append(lst[i].SORT_NO);
                            sb.Append(",sc:").Append(subcount.ToString());
                            sb.Append(",name:'").Append(lst[i].ORG_NAME).Append("',ntype:'org'}");
                        }
                    }
                    #endregion
                }
                if (nodetype == "org" || nodetype == "dept")
                {
                    #region
                    HR_DEPT objDept = new HR_DEPT();
                    HR_DEPT valDept = new HR_DEPT();
                    if (nodetype == "org")
                    {
                        objDept.ORG_ID = pid;
                        objDept.P_DEPT_ID = "0";
                    }
                    else
                    {
                        objDept.P_DEPT_ID = pid;
                    }
                    //if (Request["my"] != null)
                    //{

                    //    mydepts += mydepts == "" ? userBase.DeptID : "," + userBase.DeptID;
                    //    objDept.In(HR_DEPT.Attribute.DEPT_ID, mydepts);
                    //}
                    valDept.OrderBy(HR_DEPT.Attribute.SORT_NO, Order.Asc);
                    List<HR_DEPT> lstDept = BLLTable<HR_DEPT>.Factory(conn).Select(valDept, objDept);
                    if (lstDept.Count != null)
                    {
                        for (int i = 0; i < lstDept.Count; i++)
                        {
                            if (mypaths == null || mypaths.IndexOf("," + lstDept[i].DEPT_ID + ",") != -1)
                            {
                                if (sb.Length > 2)
                                {
                                    sb.Append(",");
                                }
                                decimal subcount = lstDept[i].SUB_NUM > 0 ? lstDept[i].SUB_NUM : 1;
                                sb.Append("{id:'").Append(lstDept[i].DEPT_ID);
                                sb.Append("',pid:'").Append(lstDept[i].P_DEPT_ID.ToString()).Append("',no:").Append(lstDept[i].SORT_NO);
                                sb.Append(",sc:").Append(subcount.ToString());
                                sb.Append(",name:'").Append(lstDept[i].DEPT_NAME).Append("',ntype:'dept'}");
                            }
                        }
                    }
                    #endregion
                }
                sb.Append("]");
                Response.Write(sb.ToString());
            }
            Response.End();
        }
    }