Пример #1
0
    protected void btnOK_Click(object sender, EventArgs e)
    {
        try
        {
            HR_ORG valObj = new HR_ORG();
            //if(txtORG_ID.Value !="" )

            if(txtORG_NAME.Value !="" )
                valObj.ORG_NAME = Convert.ToString(txtORG_NAME.Value);

            valObj.P_ORG_ID = wucSelORG1.ORG_ID;
            valObj.SORT_NO = Convert.ToInt32(txtSortNum.Value);

            if (txtSNAME.Value != "")
                valObj.SNAME = Convert.ToString(txtSNAME.Value);

            if (txtRNAME.Value != "")
                valObj.RNAME = Convert.ToString(txtRNAME.Value);

            if (txtEXP1.Value != "")
                valObj.EXP1 = Convert.ToString(txtEXP1.Value);

            if (txtEXP2.Value != "")
                valObj.EXP2 = Convert.ToString(txtEXP2.Value);

            if (txtEXP3.Value != "")
                valObj.EXP3 = Convert.ToString(txtEXP3.Value);

            if (keyid != "")
            {
                valObj.ORG_ID =keyid;
                count = ORGHelper.EditORG(valObj);// BLLTable<HR_ORG>.Factory(conn).Update(valObj, HR_ORG.Attribute.ORG_ID);
            }
            else
            {
                //count = BLLTable<HR_ORG>.Factory(conn).Insert(valObj);
                keyid = ORGHelper.AddORG(valObj, valObj.P_ORG_ID);// valObj.ORG_ID.ToString();
                count = keyid != "" ? 1 : 0;
            }
            if (count > 0)
            {
                StringBuilder sbData = new StringBuilder("({valObj:''");
                List<AttributeItem> lstCol = valObj.af_AttributeItemList;
                for (int i = 0; i < lstCol.Count; i++)
                {
                    object val = valObj.GetValue(lstCol[i]);
                    if (val != null)
                    {
                        sbData.Append(",").Append(lstCol[i].FieldName).Append(":'").Append(val.ToString()).Append("'");
                    }
                }
                sbData.Append("})");
                ScriptManager.RegisterStartupScript(Page, this.GetType(), "goto", "if (window.opener){window.opener.returnValue = 're';}else{window.returnValue = 're';}window.close();", true);
            }
        }
        catch (Exception ex)
        {
            litWarn.Text = ex.Message;
        }
    }
Пример #2
0
 protected void btnSetPageNum_Click(object sender, EventArgs e)
 {
     if (hidCondition.Value != "")
     {
         condObj = JsonServiceBase.FromJson <HR_ORG>(hidCondition.Value);
     }
     BindList(condObj, aspPager.CurrentPageIndex);
 }
Пример #3
0
 protected void btnSetPageNum_Click(object sender, EventArgs e)
 {
     if (hidCondition.Value != "")
     {
         condObj = JsonServiceBase.FromJson<HR_ORG>(hidCondition.Value);
     }
     BindList(condObj, aspPager.CurrentPageIndex);
 }
Пример #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            HR_ORG objVal  = new HR_ORG();
            HR_ORG objCond = new HR_ORG();
            objCond.P_ORG_ID = "0";
            objVal.OrderBy(HR_ORG.Attribute.ORG_ID, Order.Asc);
            List <HR_ORG> lstChnl = BLLTable <HR_ORG> .Factory(conn).Select(objVal, objCond);

            StringBuilder sb = new StringBuilder();
            if (lstChnl.Count > 0)
            {
                sb.Append("<li id=\"root_0\" data=\"{rid:'0',id:'0',pid:'0',sc:0,name:'机构选择'}\" 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_ORG> .Factory(conn).Select(HR_ORG.Attribute.P_ORG_ID, lstChnl[i].ORG_ID).Count;

                    if (subcount < 1)
                    {
                        if (licls != "")
                        {
                            licls += " ";
                        }
                        licls += "leaf";
                    }
                    if (licls != "")
                    {
                        licls = " class='" + licls + "'";
                    }
                    sbData.Append("{rid:'0',id:'").Append(lstChnl[i].ORG_ID.ToString());
                    sbData.Append("',pid:'").Append(lstChnl[i].P_ORG_ID).Append("',no:").Append(lstChnl[i].ORG_ID.ToString());
                    sbData.Append(",sc:").Append(subcount.ToString());
                    sbData.Append(",name:'").Append(lstChnl[i].ORG_NAME).Append("'}");

                    sb.Append("<li " + licls + " id='node_" + lstChnl[i].ORG_ID + "' data=\"" + sbData.ToString() + "\"><div><b></b><em></em><a href='#'>" + lstChnl[i].ORG_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:'机构选择'}\" class=\"root\"><div class='root'><b></b><em></em><a href=\"#\">机构选择</a></div></li>");
            }
            litChnl.Text = sb.ToString();
        }
    }
Пример #5
0
    private void BindList(HR_ORG condObj, int curPage)
    {
        if (condObj.af_PageByAttributeItem == null)//如果不存在用户定义的分页排序属性,则用主键属性排序
        {
            condObj.af_PageBy(HR_ORG.Attribute.ORG_ID, Order.Desc);
        }
        listObj = BLLTable <HR_ORG> .Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, curPage, ref recount);

        repList.DataSource = listObj;
        repList.DataBind();
        aspPager.RecordCount = recount;
    }
Пример #6
0
    protected void btnFind_Click(object sender, EventArgs e)
    {
        condObj = new HR_ORG();

        if(txtORG_ID.Value !="" )
            condObj.Like(HR_ORG.Attribute.ORG_ID, Convert.ToString(txtORG_ID.Value));

        if(txtORG_NAME.Value !="" )
            condObj.Like(HR_ORG.Attribute.ORG_NAME, Convert.ToString(txtORG_NAME.Value));

        hidCondition.Value = condObj.ToJson(20);

        BindList(condObj, 1);
    }
Пример #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            HR_ORG objVal = new HR_ORG();
            HR_ORG objCond = new HR_ORG();
            objCond.P_ORG_ID = "0";
            objVal.OrderBy(HR_ORG.Attribute.ORG_ID, Order.Asc);
            List<HR_ORG> lstChnl = BLLTable<HR_ORG>.Factory(conn).Select(objVal,objCond);
            StringBuilder sb = new StringBuilder();
            if (lstChnl.Count > 0)
            {
                sb.Append("<li id=\"root_0\" data=\"{rid:'0',id:'0',pid:'0',sc:0,name:'机构选择'}\" 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_ORG>.Factory(conn).Select(HR_ORG.Attribute.P_ORG_ID, lstChnl[i].ORG_ID).Count;

                    if (subcount<1)
                    {
                        if (licls != "") { licls += " "; }
                        licls += "leaf";
                    }
                    if (licls != "") { licls = " class='" + licls + "'"; }
                    sbData.Append("{rid:'0',id:'").Append(lstChnl[i].ORG_ID.ToString());
                    sbData.Append("',pid:'").Append(lstChnl[i].P_ORG_ID).Append("',no:").Append(lstChnl[i].ORG_ID.ToString());
                    sbData.Append(",sc:").Append(subcount.ToString());
                    sbData.Append(",name:'").Append(lstChnl[i].ORG_NAME).Append("'}");

                    sb.Append("<li " + licls + " id='node_" + lstChnl[i].ORG_ID + "' data=\"" + sbData.ToString() + "\"><div><b></b><em></em><a href='#'>" + lstChnl[i].ORG_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:'机构选择'}\" class=\"root\"><div class='root'><b></b><em></em><a href=\"#\">机构选择</a></div></li>");

            }
            litChnl.Text = sb.ToString();
        }
    }
Пример #8
0
    protected void btnFind_Click(object sender, EventArgs e)
    {
        condObj = new HR_ORG();



        if (txtORG_ID.Value != "")
        {
            condObj.Like(HR_ORG.Attribute.ORG_ID, Convert.ToString(txtORG_ID.Value));
        }


        if (txtORG_NAME.Value != "")
        {
            condObj.Like(HR_ORG.Attribute.ORG_NAME, Convert.ToString(txtORG_NAME.Value));
        }

        hidCondition.Value = condObj.ToJson(20);

        BindList(condObj, 1);
    }
    private void BindList(HR_CHECKWORKDEVICE condObj, int curPage)
    {
        if (condObj.af_PageByAttributeItem == null)//如果不存在用户定义的分页排序属性,则用主键属性排序
        {
            condObj.af_PageBy(HR_CHECKWORKDEVICE.Attribute.DeviceID, Order.Desc);
        }

        #region//数据权限条件

        #endregion
        //condObj.PID = decimal.Parse(pid);
        HR_ORG orgVal = new HR_ORG();
        orgVal._ORG_NAME = "";
        Relation rt = new Relation(HR_CHECKWORKDEVICE.Attribute.ORG_ID, HR_ORG.Attribute.ORG_ID);

        listObj = BLLTable <HR_CHECKWORKDEVICE> .Factory(conn).SelectByPage(valObj, rt, orgVal, condObj, aspPager.PageSize, curPage, ref recount);

        repList.DataSource = listObj;
        repList.DataBind();
        aspPager.RecordCount = recount;
    }
Пример #10
0
 protected void repList_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     try
     {
         HtmlInputCheckBox ckOrg = (HtmlInputCheckBox)e.Item.FindControl("ckORG");
         if (ckOrg != null)
         {
             HR_ORG cond = new HR_ORG();
             cond.P_ORG_ID = ckOrg.Value;
             if (BLLTable <HR_ORG> .Exists(cond))
             {
                 Literal litSub = (Literal)e.Item.FindControl("litSub");
                 if (litSub != null)
                 {
                     litSub.Text = "---<a href='ORGPower.aspx?PID=" + cond.P_ORG_ID + "'><b>下级机构</b></a>";
                 }
             }
         }
     }
     catch (Exception ex)
     {
         litWarn.Text = ex.Message;
     }
 }
Пример #11
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();
        }
    }
Пример #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        title      = valObj._ZhName + "±à¼­";
        Page.Title = title;
        if (!string.IsNullOrEmpty(Request["KeyID"]))
        {
            keyid = Request["KeyID"];
        }
        if (!string.IsNullOrEmpty(Request["ORG_ID"]))
        {
            keyid = Request["ORG_ID"];
        }
        if (!string.IsNullOrEmpty(Request["PID"]))
        {
            pid = Request["PID"];
        }
        if (!IsPostBack)
        {
            try
            {
                if (keyid != "")
                {
                    valObj = BLLTable <HR_ORG> .Factory(conn).GetRowData(HR_ORG.Attribute.ORG_ID, keyid);

                    if (valObj == null)
                    {
                        return;
                    }

                    txtSortNum.Value = valObj.SORT_NO.ToString();
                    txtORG_ID.Value  = Convert.ToString(valObj.ORG_ID);     //Convert.ToString

                    txtORG_NAME.Value = Convert.ToString(valObj.ORG_NAME);  //Convert.ToString

                    wucSelORG1.ORG_ID  = Convert.ToString(valObj.P_ORG_ID); //Convert.ToString
                    wucSelORG1.Enabled = false;
                    //wucSelORG1.ORG_NAME = BLLTable<HR_ORG>.Factory(conn).GetOneValue(HR_ORG.Attribute.ORG_ID, valObj.P_ORG_ID, HR_ORG.Attribute.ORG_NAME);

                    txtSNAME.Value = Convert.ToString(valObj.SNAME); //Convert.ToString

                    txtRNAME.Value = Convert.ToString(valObj.RNAME); //Convert.ToString

                    txtEXP1.Value = Convert.ToString(valObj.EXP1);   //Convert.ToString

                    txtEXP2.Value = Convert.ToString(valObj.EXP2);   //Convert.ToString

                    txtEXP3.Value = Convert.ToString(valObj.EXP3);   //Convert.ToString

                    wucSelORG1.Enabled = false;
                }
                else
                {
                    if (pid != "" && pid != "0")
                    {
                        wucSelORG1.ORG_ID  = pid;//Convert.ToString
                        wucSelORG1.Enabled = false;
                    }
                }
            }
            catch (Exception ex)
            {
                litWarn.Text = ex.Message;
            }
        }
    }
Пример #13
0
    protected void btnOK_Click(object sender, EventArgs e)
    {
        try
        {
            HR_ORG valObj = new HR_ORG();
            //if(txtORG_ID.Value !="" )

            if (txtORG_NAME.Value != "")
            {
                valObj.ORG_NAME = Convert.ToString(txtORG_NAME.Value);
            }

            valObj.P_ORG_ID = wucSelORG1.ORG_ID;
            valObj.SORT_NO  = Convert.ToInt32(txtSortNum.Value);

            if (txtSNAME.Value != "")
            {
                valObj.SNAME = Convert.ToString(txtSNAME.Value);
            }


            if (txtRNAME.Value != "")
            {
                valObj.RNAME = Convert.ToString(txtRNAME.Value);
            }

            if (txtEXP1.Value != "")
            {
                valObj.EXP1 = Convert.ToString(txtEXP1.Value);
            }


            if (txtEXP2.Value != "")
            {
                valObj.EXP2 = Convert.ToString(txtEXP2.Value);
            }


            if (txtEXP3.Value != "")
            {
                valObj.EXP3 = Convert.ToString(txtEXP3.Value);
            }

            if (keyid != "")
            {
                valObj.ORG_ID = keyid;
                count         = ORGHelper.EditORG(valObj);// BLLTable<HR_ORG>.Factory(conn).Update(valObj, HR_ORG.Attribute.ORG_ID);
            }
            else
            {
                //count = BLLTable<HR_ORG>.Factory(conn).Insert(valObj);
                keyid = ORGHelper.AddORG(valObj, valObj.P_ORG_ID);// valObj.ORG_ID.ToString();
                count = keyid != "" ? 1 : 0;
            }
            if (count > 0)
            {
                StringBuilder        sbData = new StringBuilder("({valObj:''");
                List <AttributeItem> lstCol = valObj.af_AttributeItemList;
                for (int i = 0; i < lstCol.Count; i++)
                {
                    object val = valObj.GetValue(lstCol[i]);
                    if (val != null)
                    {
                        sbData.Append(",").Append(lstCol[i].FieldName).Append(":'").Append(val.ToString()).Append("'");
                    }
                }
                sbData.Append("})");
                ScriptManager.RegisterStartupScript(Page, this.GetType(), "goto", "if (window.opener){window.opener.returnValue = 're';}else{window.returnValue = 're';}window.close();", true);
            }
        }
        catch (Exception ex)
        {
            litWarn.Text = ex.Message;
        }
    }
Пример #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //在列表里点击删除按钮,通过AJAX执行这里的后台代码,删除一条记录
        if (Request["USER_ID"] != null && Request["delFromUserRole"] != null)
        {
            SYS_USERDATA delCond = new SYS_USERDATA();
            delCond.USER_ID   = decimal.Parse(Request["USER_ID"]);
            delCond.DATA_TYPE = Request["Data_Type"];
            delCond.In(SYS_USERDATA.Attribute.DATA_ID, Request["delFromUserRole"]);

            BLLTable <SYS_USERDATA> .Factory(conn).Delete(delCond);

            Response.Write("{}");
        }
        if (Request["USER_ID"] != null && Request["AddToUserData"] != null)
        {
            SYS_USERDATA valObj = new SYS_USERDATA();
            valObj.USER_ID = decimal.Parse(Request["USER_ID"]);
            string datatype = Request["Data_Type"];
            valObj.DATA_TYPE = datatype;
            string[] arrDataID = null;
            string   dataid    = Request["AddToUserData"];
            if (dataid.IndexOf(",") == -1)
            {
                arrDataID = new string[] { dataid };
            }
            else
            {
                arrDataID = dataid.Split(',');
            }
            if (valObj.DATA_ID != "0")
            {
                SYS_USERDATA delCond = new SYS_USERDATA();
                delCond.USER_ID   = valObj.USER_ID;
                delCond.DATA_TYPE = datatype;
                BLLTable <SYS_USERDATA> .Factory(conn).Delete(delCond);
            }

            StringBuilder sbData = new StringBuilder("[");
            for (int a = 0; a < arrDataID.Length; a++)
            {
                valObj.DATA_ID = arrDataID[a];

                if (!BLLTable <SYS_USERDATA> .Exists(valObj))
                {
                    int re = BLLTable <SYS_USERDATA> .Factory(conn).Insert(valObj);

                    if (re > 0)
                    {
                        if (sbData.Length > 1)
                        {
                            sbData.Append(",");
                        }
                        sbData.Append("{valObj:''");

                        if (datatype.IndexOf("HR_ORG") != -1)
                        {
                            #region//
                            HR_ORG valORG = BLLTable <HR_ORG> .Factory(conn).GetRowData(HR_ORG.Attribute.ORG_ID, valObj.DATA_ID);

                            List <AttributeItem> lstCol = valORG.af_AttributeItemList;
                            for (int i = 0; i < lstCol.Count; i++)
                            {
                                object val = valORG.GetValue(lstCol[i]);
                                if (val != null)
                                {
                                    sbData.Append(",").Append(lstCol[i].FieldName).Append(":'").Append(val.ToString()).Append("'");
                                }
                            }
                            #endregion
                        }
                        else if (datatype.IndexOf("HR_DEPT") != -1)
                        {
                            #region//
                            HR_DEPT valORG = BLLTable <HR_DEPT> .Factory(conn).GetRowData(HR_DEPT.Attribute.DEPT_ID, valObj.DATA_ID);

                            List <AttributeItem> lstCol = valORG.af_AttributeItemList;
                            for (int i = 0; i < lstCol.Count; i++)
                            {
                                object val = valORG.GetValue(lstCol[i]);
                                if (val != null)
                                {
                                    sbData.Append(",").Append(lstCol[i].FieldName).Append(":'").Append(val.ToString()).Append("'");
                                }
                            }
                            #endregion
                        }
                        else if (datatype.IndexOf("IM_STORAGE") != -1)
                        {
                            #region//
                            IM_STORAGE valORG = BLLTable <IM_STORAGE> .Factory(conn).GetRowData(IM_STORAGE.Attribute.STOR_ID, valObj.DATA_ID);

                            List <AttributeItem> lstCol = valORG.af_AttributeItemList;
                            for (int i = 0; i < lstCol.Count; i++)
                            {
                                object val = valORG.GetValue(lstCol[i]);
                                if (val != null)
                                {
                                    sbData.Append(",").Append(lstCol[i].FieldName).Append(":'").Append(val.ToString()).Append("'");
                                }
                            }
                            #endregion
                        }
                        sbData.Append("}");
                    }
                }
            }
            sbData.Append("]");
            Response.Write(sbData.ToString());
        }

        //在列表顶部点击删除按钮,通过AJAX执行这里的后台代码,删除多条记录
        if (Request["DelKeyIDS"] != null)
        {
            if (Request["USER_ID"] != null)
            {
                SYS_USERDATA cond = new SYS_USERDATA();
                cond.In(SYS_USERDATA.Attribute.DATA_ID, Request["DelKeyIDS"]);
                cond.DATA_TYPE = Request["Data_Type"];
                cond.USER_ID   = decimal.Parse(Request["USER_ID"]);
                int re = BLLTable <SYS_USERDATA> .Factory(conn).Delete(cond);

                if (re > 0)
                {
                    Response.Write("1");//可以输出数字 大于0 表示操作成功,也可以直接输出 字符串,客户端将弹出此字符串信息作为提示
                }
                else
                {
                    Response.Write("删除失败!");
                }
            }
            else
            {
                SYS_USERDATA cond = new SYS_USERDATA();
                cond.In(SYS_USERDATA.Attribute.USER_ID, Request["DelKeyIDS"]);
                int re = BLLTable <SYS_USERDATA> .Factory(conn).Delete(cond);

                if (re > 0)
                {
                    Response.Write("1");//可以输出数字 大于0 表示操作成功,也可以直接输出 字符串,客户端将弹出此字符串信息作为提示
                }
                else
                {
                    Response.Write("删除失败!");
                }
            }
        }

        //在用户详细信息查看编辑页面,点保存时,通过AJAX执行这里的后台代码,实现部门字段的更新
        if (Request["saveInfo"] != null)
        {
            SYS_USERDATA val = new SYS_USERDATA();
            val.USER_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 <SYS_USERDATA> .Factory(conn).Update(val, SYS_USERDATA.Attribute.USER_ID);

            Response.Write("修改用户信息成功");
        }
        Response.End();
    }
Пример #15
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();
    }
Пример #16
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();
        }
    }
Пример #17
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();
        }
    }
Пример #18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        title      = "É豸±à¼­";
        Page.Title = title;
        if (!string.IsNullOrEmpty(Request["DeviceID"]))
        {
            keyid = Request["DeviceID"];
        }

        if (!string.IsNullOrEmpty(Request["KeyID"]))
        {
            keyid = Request["KeyID"];
        }
        if (!IsPostBack)
        {
            OtherDeviceHelper.GetTableDataSet(path, new HR_DEPT());
            OtherDeviceHelper.GetTableDataSet(path, new HR_STAFF());
            txtUSE_FLAG.Items.AddRange(FormHelper.GetListItem(HR_CHECKWORKDEVICE.Attribute.USE_FLAG));
            txtUSE_FLAG.Items.RemoveAt(0);

            ListItem[] deptTables  = new ListItem[0];
            ListItem[] staffTables = new ListItem[0];
            GetDeptAndStaffTableFangAnItems(ref deptTables, ref staffTables);
            txtDeptTable.Items.AddRange(deptTables);
            txtStaffTable.Items.AddRange(staffTables);

            this.txtDeviceID.Disabled            = true;
            this.txtDeviceID.Attributes["class"] = "dis";
            try
            {
                if (keyid != "")
                {
                    HR_CHECKWORKDEVICE val = new HR_CHECKWORKDEVICE();
                    HR_CHECKWORKDEVICE con = new HR_CHECKWORKDEVICE();
                    con._DeviceID = keyid;
                    HR_ORG pyVal = new HR_ORG();
                    pyVal._ORG_NAME = "";
                    Relation rt = new Relation(HR_CHECKWORKDEVICE.Attribute.ORG_ID, HR_ORG.Attribute.ORG_ID);
                    List <HR_CHECKWORKDEVICE> devList = BLLTable <HR_CHECKWORKDEVICE> .Factory(conn).Select(val, rt, pyVal, con);

                    if (devList == null || devList.Count < 1)
                    {
                        return;
                    }
                    txtDeviceID.Value   = Convert.ToString(devList[0].DeviceID); //Convert.ToString
                    txtDeviceName.Value = devList[0].DeviceName;
                    wucSelORG1.ORG_ID   = Convert.ToString(devList[0].ORG_ID);   //Convert.ToString
                    wucSelORG1.ORG_NAME = Convert.ToString(devList[0].GetValue(HR_ORG.Attribute.ORG_NAME));
                    txtUSE_FLAG.Value   = devList[0].USE_FLAG.ToString();
                    string file = devList[0].DeptTable;
                    file = string.IsNullOrEmpty(file) ? "" : file;
                    if (txtDeptTable.Items.FindByValue(file) != null)
                    {
                        txtDeptTable.Value = file;
                    }
                    else
                    {
                        if (txtDeptTable.Items.FindByValue("-1") == null)
                        {
                            txtDeptTable.Items.Add(new ListItem("´íÎó·½°¸", "-1"));
                        }
                        txtDeptTable.Value = "-1";
                    }
                    file = devList[0].StaffTable;
                    file = string.IsNullOrEmpty(file) ? "" : file;
                    if (txtStaffTable.Items.FindByValue(file) != null)
                    {
                        txtStaffTable.Value = file;
                    }
                    else
                    {
                        if (txtStaffTable.Items.FindByValue("-1") == null)
                        {
                            txtStaffTable.Items.Add(new ListItem("´íÎó·½°¸", "-1"));
                        }
                        txtStaffTable.Value = "-1";
                    }
                }
            }
            catch (Exception ex)
            {
                litWarn.Text = ex.Message;
            }
        }
    }
Пример #19
0
 protected void repList_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     try
     {
         HtmlInputCheckBox ckOrg = (HtmlInputCheckBox)e.Item.FindControl("ckORG");
         if (ckOrg != null) {
             HR_ORG cond=new HR_ORG();
             cond.P_ORG_ID=ckOrg.Value;
             if (BLLTable<HR_ORG>.Exists(cond))
             {
                 Literal litSub = (Literal)e.Item.FindControl("litSub");
                 if (litSub != null)
                 {
                     litSub.Text = "---<a href='ORGPower.aspx?PID=" + cond.P_ORG_ID + "'><b>�¼�����</b></a>";
                 }
             }
         }
     }
     catch (Exception ex)
     {
        litWarn.Text = ex.Message;
     }
 }
Пример #20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //���б�����ɾ����ť��ͨ��AJAXִ������ĺ�̨���룬ɾ��һ����¼
        if (Request["DelORG_ID"] != null)
        {
            int re = ORGHelper.DelORG(Request["DelORG_ID"]);// BLLTable<HR_ORG>.Factory(conn).Delete(HR_ORG.Attribute.ORG_ID, Request["DelORG_ID"]);
            if (re > 0)
            {
                Response.Write("1");//����������� ����0 ��ʾ�����ɹ���Ҳ����ֱ����� �ַ������ͻ��˽��������ַ�����Ϣ��Ϊ��ʾ
            }
            else
            {
                Response.Write("ɾ��ʧ�ܣ�");
            }
        }

        //���б�������ɾ����ť��ͨ��AJAXִ������ĺ�̨���룬ɾ��������¼
        if (Request["DelKeyIDS"] != null)
        {
            //HR_ORG cond = new HR_ORG();
            //cond.In(HR_ORG.Attribute.ORG_ID, Request["DelKeyIDS"]);
            int re = ORGHelper.DelORG(Request["DelKeyIDS"]);// BLLTable<HR_ORG>.Factory(conn).Delete(cond);
            if (re > 0)
            {
                Response.Write("1");//����������� ����0 ��ʾ�����ɹ���Ҳ����ֱ����� �ַ������ͻ��˽��������ַ�����Ϣ��Ϊ��ʾ
            }
            else
            {
                Response.Write("ɾ��ʧ�ܣ�");
            }
        }

        //���û���ϸ��Ϣ�鿴�༭ҳ�棬�㱣��ʱ��ͨ��AJAXִ������ĺ�̨���룬ʵ�ֲ����ֶεĸ���
        if (Request["saveInfo"] != null)
        {
            HR_ORG val = new HR_ORG();
            val.ORG_ID = 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_ORG>.Factory(conn).Update(val, HR_ORG.Attribute.ORG_ID);
            Response.Write("�޸��û���Ϣ�ɹ�");

        }

        //��ʾ�ӽڵ�
        if (Request["ShowSubNodes"] != null)
        {
            #region
            string pid = Request["id"];
            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 > 0)
            {
                StringBuilder sb = new StringBuilder("[");
                for (int i = 0; i < lst.Count; i++)
                {
                    if (i > 0)
                    {
                        sb.Append(",");
                    }
                    int subcount = BLLTable<HR_ORG>.Factory(conn).Select(HR_ORG.Attribute.P_ORG_ID, lst[i].ORG_ID).Count;

                    sb.Append("{rid:'").Append(lst[i].P_ORG_ID).Append("',id:'").Append(lst[i].ORG_ID.ToString());
                    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("'}");

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

            #endregion
        }
        //ɾ��Ⱥ��
        if (Request["DelNodeID"] != null)
        {
            string keyid = Request["id"];
            int re = BLLTable<HR_ORG>.Factory(conn).Delete(HR_ORG.Attribute.ORG_ID, keyid);
            if (re > 0)
            {
                HR_ORG cond = new HR_ORG();
                cond.ORG_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_ORG>.Factory(conn).Update(HR_ORG.Attribute.ORG_ID, chgid1, HR_ORG.Attribute.SORT_NO, chgsort1);
                re = BLLTable<HR_ORG>.Factory(conn).Update(HR_ORG.Attribute.ORG_ID, chgid2, HR_ORG.Attribute.SORT_NO, chgsort2);

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

        }

        Response.End();
    }
Пример #21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //在列表里点击删除按钮,通过AJAX执行这里的后台代码,删除一条记录
        if (Request["DelORG_ID"] != null)
        {
            int re = ORGHelper.DelORG(Request["DelORG_ID"]);// BLLTable<HR_ORG>.Factory(conn).Delete(HR_ORG.Attribute.ORG_ID, Request["DelORG_ID"]);
            if (re > 0)
            {
                Response.Write("1");//可以输出数字 大于0 表示操作成功,也可以直接输出 字符串,客户端将弹出此字符串信息作为提示
            }
            else
            {
                Response.Write("删除失败!");
            }
        }

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

        //在用户详细信息查看编辑页面,点保存时,通过AJAX执行这里的后台代码,实现部门字段的更新
        if (Request["saveInfo"] != null)
        {
            HR_ORG val = new HR_ORG();
            val.ORG_ID = 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_ORG> .Factory(conn).Update(val, HR_ORG.Attribute.ORG_ID);

            Response.Write("修改用户信息成功");
        }

        //显示子节点
        if (Request["ShowSubNodes"] != null)
        {
            #region
            string pid = Request["id"];
            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 > 0)
            {
                StringBuilder sb = new StringBuilder("[");
                for (int i = 0; i < lst.Count; i++)
                {
                    if (i > 0)
                    {
                        sb.Append(",");
                    }
                    int subcount = BLLTable <HR_ORG> .Factory(conn).Select(HR_ORG.Attribute.P_ORG_ID, lst[i].ORG_ID).Count;

                    sb.Append("{rid:'").Append(lst[i].P_ORG_ID).Append("',id:'").Append(lst[i].ORG_ID.ToString());
                    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("'}");
                }
                sb.Append("]");
                Response.Write(sb.ToString());
            }



            #endregion
        }
        //删除群组
        if (Request["DelNodeID"] != null)
        {
            string keyid = Request["id"];
            int    re    = BLLTable <HR_ORG> .Factory(conn).Delete(HR_ORG.Attribute.ORG_ID, keyid);

            if (re > 0)
            {
                HR_ORG cond = new HR_ORG();
                cond.ORG_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_ORG> .Factory(conn).Update(HR_ORG.Attribute.ORG_ID, chgid1, HR_ORG.Attribute.SORT_NO, chgsort1);

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

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

        Response.End();
    }
Пример #22
0
    protected void btnOK_Click(object sender, EventArgs e)
    {
        WFOBJECT_BLL wfobj = new WFOBJECT_BLL(wf_obj_id);
        Button       btn   = (Button)sender;//当前单击的按钮
        //WFINFO_EXD wfExd = new WFINFO_EXD(wfid,0);
        WFRecordInfo recInfo = new WFRecordInfo(wf_obj_id, recid);

        //FORM_BLL wform = wfobj.FORM_BLL;

        WF_FORMBASE valObj = new WF_FORMBASE();

        //WF_FORMDETAIL formDetail = null;
        #region                        //通用基本信息赋值
        valObj.RECNO = txtRECNO.Value; //单号唯一

        if (txtDEPT_ID.DEPT_ID != "")
        {
            valObj.DEPT_ID = Convert.ToString(txtDEPT_ID.DEPT_ID);

            HR_DEPT dept = BLLTable <HR_DEPT> .Factory(conn).GetRowData(HR_DEPT.Attribute.DEPT_ID, valObj.DEPT_ID);

            HR_ORG org = BLLTable <HR_ORG> .Factory(conn).GetRowData(HR_ORG.Attribute.ORG_ID, dept.ORG_ID);

            valObj.ORG_ID    = org.ORG_ID;
            valObj.ORG_NAME  = org.ORG_NAME;
            valObj.DEPT_NAME = dept.DEPT_NAME;
        }

        if (txtSTAFF_ID.Staff_ID > 0)
        {
            valObj.STAFF_ID   = txtSTAFF_ID.Staff_ID;
            valObj.STAFF_NAME = txtSTAFF_ID.Staff_NAME;
        }

        if (txtCSTAFF_ID.Value != "")
        {
            valObj.CSTAFF_ID  = Convert.ToDecimal(txtCSTAFF_ID.Value);
            valObj.CDEPT_ID   = txtCDEPT_ID.Value;
            valObj.CDEPT_NAME = txtCDEPT_NAME.Value;

            HR_DEPT_STAFF cond = new HR_DEPT_STAFF();
            cond.STAFF_ID = valObj.CSTAFF_ID;
            Relation reldep = new Relation(HR_DEPT_STAFF.Attribute.DEPT_ID, HR_DEPT.Attribute.DEPT_ID);
            Relation relorg = new Relation(HR_ORG.Attribute.ORG_ID, HR_DEPT.Attribute.ORG_ID);

            List <Relation> lstrel = new List <Relation>();
            lstrel.Add(reldep);
            lstrel.Add(relorg);

            List <ITableImplement> lstcond = new List <ITableImplement>();
            lstcond.Add(cond);

            List <HR_ORG> lstOrg = BLLTable <HR_ORG> .Select(new HR_ORG(), lstrel, null, lstcond);

            if (lstOrg.Count > 0)
            {
                valObj.CORG_ID   = lstOrg[0].ORG_ID;
                valObj.CORG_NAME = lstOrg[0].ORG_NAME;
            }
        }
        if (txtCSTAFF_NAME.Value != "")
        {
            valObj.CSTAFF_NAME = Convert.ToString(txtCSTAFF_NAME.Value);
        }
        valObj.EDITIME    = DateTime.Now;
        valObj.NOTE       = txtNOTE.Value;
        valObj.ANNEX_FILE = UpFilesBfSubmit1.GetUpFilesString();

        //if (hadDetail)//若有明细表单,创建明细表单通用信息对象并赋值
        //{
        //    formDetail = new WF_FORMDETAIL();
        //    formDetail.DEPT_ID = valObj.DEPT_ID;
        //    formDetail.DEPT_NAME = valObj.DEPT_NAME;
        //    formDetail.STAFF_ID = valObj.STAFF_ID;
        //    formDetail.STAFF_NAME = valObj.STAFF_NAME;
        //    formDetail.STATUS = "0";
        //    formDetail.DETAIL_NO = "0";
        //}
        #endregion
        if (recid > 0)
        {
            #region//编辑单据信息

            valObj.RECID       = recid;
            valObj.WFID        = wf_obj_id;
            valObj.FORM_PRI_ID = recInfo.Base.FORM_PRI_ID; //扩展表修改必须使用此字段的值。*********

            count = wfobj.UpdateRecord(valObj);            //【2】通用单据信息赋值,与配置扩展信息同时保存到数据库。
            if (count < 0)
            {
                litWarn.Text = "保存基本信息失败。";//【2】保存信息失败,提示。。
                return;
            }
            if (hadDetail && hidDetailRows.Value != "")
            {
                int rows = int.Parse(hidDetailRows.Value);//【3】判断是否有明细信息,若有,保存明细信息到数据库。
                //formDetail.RECID = recid;
                wfobj.UpdateDetail(valObj, rows);
            }

            //jinsj  获取页面静态代码
            WFOBJECT_BLL wfbll  = new WFOBJECT_BLL(wf_obj_id, recid);
            WFRecordInfo recObj = new WFRecordInfo(valObj, true);
            WF_FORMBASE  objUp  = new WF_FORMBASE();
            objUp.RECID     = recid;
            objUp.HTML_TEXT = wfbll.FORM_BLL.WF_HtmlShowForm(recObj);
            BLLTable <WF_FORMBASE> .Factory(conn).Update(objUp, WF_FORMBASE.Attribute.RECID);

            if (btn.ID.IndexOf("btnOK") != -1)//重新提交单据,进入审批流程
            {
                backUrl = WebHelper.GetAppPath() + "WF/Checkers.aspx?Submit=1&WFID=" + wf_obj_id + "&PROCID=" + 0 + "&RECID=" + recid;
            }
            Response.Redirect(backUrl);

            #endregion
        }
        else
        {
            #region//新建单据
            valObj.ADDTIME    = DateTime.Now;
            valObj.RECNAME    = "[" + userBase.StaffName + "]" + wfcname + valObj.ADDTIME.ToString("yyyyMMddHHmm");
            valObj.WFID       = wf_obj_id;
            valObj.PROCID     = 0;
            valObj.CHECK_INFO = "";
            valObj.CHECKERS   = "";
            valObj.STATUS     = WFEnum.RecStatus.Submit.ToString("d");
            //AgileFrame.Orm.PersistenceLayer.DAL.Base.Runtime_PersistenceLayer.RefreshRuntime_PersistenceLayer();
            count = wfobj.InsertRecord(valObj);//【1】通用单据信息赋值,与配置扩展信息同时保存到数据库
            if (count <= 0)
            {
                litWarn.Text = "单据信息保存失败,请联系管理员。";//【1】保存信息失败,提示
                return;
            }
            recid = valObj.RECID;
            if (hadDetail && hidDetailRows.Value != "")//【2】判断是否有明细信息,若有,保存明细信息到数据库。
            {
                int rows = int.Parse(hidDetailRows.Value);
                //formDetail.RECID = recid;
                wfobj.InsertDetail(valObj, rows);
            }

            //jinsj  获取页面静态代码
            WFOBJECT_BLL wfbll  = new WFOBJECT_BLL(wf_obj_id, recid);
            WFRecordInfo recObj = new WFRecordInfo(valObj, true);
            WF_FORMBASE  objUp  = new WF_FORMBASE();
            objUp.RECID     = recid;
            objUp.HTML_TEXT = wfbll.FORM_BLL.WF_HtmlShowForm(recObj);
            BLLTable <WF_FORMBASE> .Factory(conn).Update(objUp, WF_FORMBASE.Attribute.RECID);

            if (btn.ID.IndexOf("btnOK") != -1)
            {
                string err = "";
                //bool ck = wfobj.WF_CheckStepChecker(recid, out err);
                bool ck = true;
                if (ck == false)
                {
                    ScriptHelper.AlertAndGo(Page, err + " 无法提交。", "FormList.aspx?mine=1&WFID=" + wf_obj_id);
                }
                else
                {
                    string chckerUrl = WebHelper.GetAppPath() + "WF/Checkers.aspx?Submit=1&WFID=" + wf_obj_id + "&RECID=" + recid;
                    Response.Redirect(chckerUrl, false);//【6】转到审批人选择页面
                }
            }
            else
            {
                if (recid > 0)
                {
                    Response.Redirect(backUrl);//【3】跳转到原来的页面。
                }
                else
                {
                    AgileFrame.Core.ScriptHelper.Alert(Page, "保存失败!");
                }
            }
            #endregion
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        title = "�豸�༭";
        Page.Title = title;
        if (!string.IsNullOrEmpty(Request["DeviceID"]))
        {
            keyid = Request["DeviceID"];
        }

        if (!string.IsNullOrEmpty(Request["KeyID"]))
        {
            keyid = Request["KeyID"];
        }
        if (!IsPostBack)
        {
            OtherDeviceHelper.GetTableDataSet(path, new HR_DEPT());
            OtherDeviceHelper.GetTableDataSet(path, new HR_STAFF());
            txtUSE_FLAG.Items.AddRange(FormHelper.GetListItem(HR_CHECKWORKDEVICE.Attribute.USE_FLAG));
            txtUSE_FLAG.Items.RemoveAt(0);

            ListItem[] deptTables = new ListItem[0];
            ListItem[] staffTables = new ListItem[0];
            GetDeptAndStaffTableFangAnItems(ref deptTables, ref staffTables);
            txtDeptTable.Items.AddRange(deptTables);
            txtStaffTable.Items.AddRange(staffTables);

            this.txtDeviceID.Disabled = true;
            this.txtDeviceID.Attributes["class"] = "dis";
            try
            {
                if (keyid != "")
                {
                    HR_CHECKWORKDEVICE val = new HR_CHECKWORKDEVICE();
                    HR_CHECKWORKDEVICE con = new HR_CHECKWORKDEVICE();
                    con._DeviceID = keyid;
                    HR_ORG pyVal = new HR_ORG();
                    pyVal._ORG_NAME = "";
                    Relation rt = new Relation(HR_CHECKWORKDEVICE.Attribute.ORG_ID, HR_ORG.Attribute.ORG_ID);
                    List<HR_CHECKWORKDEVICE> devList = BLLTable<HR_CHECKWORKDEVICE>.Factory(conn).Select(val, rt, pyVal, con);
                    if (devList == null || devList.Count < 1) return;
                    txtDeviceID.Value = Convert.ToString(devList[0].DeviceID);//Convert.ToString
                    txtDeviceName.Value = devList[0].DeviceName;
                    wucSelORG1.ORG_ID = Convert.ToString(devList[0].ORG_ID);//Convert.ToString
                    wucSelORG1.ORG_NAME = Convert.ToString(devList[0].GetValue(HR_ORG.Attribute.ORG_NAME));
                    txtUSE_FLAG.Value = devList[0].USE_FLAG.ToString();
                    string file = devList[0].DeptTable;
                    file = string.IsNullOrEmpty(file) ? "" : file;
                    if (txtDeptTable.Items.FindByValue(file) != null)
                        txtDeptTable.Value = file;
                    else
                    {
                        if (txtDeptTable.Items.FindByValue("-1") == null)
                            txtDeptTable.Items.Add(new ListItem("���󷽰�", "-1"));
                        txtDeptTable.Value = "-1";
                    }
                    file = devList[0].StaffTable;
                    file = string.IsNullOrEmpty(file) ? "" : file;
                    if (txtStaffTable.Items.FindByValue(file) != null)
                        txtStaffTable.Value = file;
                    else
                    {
                        if (txtStaffTable.Items.FindByValue("-1") == null)
                            txtStaffTable.Items.Add(new ListItem("���󷽰�", "-1"));
                        txtStaffTable.Value = "-1";
                    }
                }
            }
            catch (Exception ex)
            {
                litWarn.Text = ex.Message;
            }
        }
    }
Пример #24
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();
        }
    }
Пример #25
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Title = title;
        if (!IsPostBack)
        {
            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);
            StringBuilder sb = new StringBuilder();
            if (lstChnl.Count > 0)
            {
                sb.Append("<li id=\"root_0\" data=\"{id:'0',pid:'0',sc:0,name:'组织机构管理',ntype:'root'}\" class=\"root\" exp='2'><div class=\"opened root\"><b></b><em></em><a href=\"#\" onclick='gotoMangerOrg()'>组织机构管理</a><a href='CollOrgManger.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 = 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:'root'}\" class=\"root\"><div class='root'><b></b><em></em><a href=\"#\" onclick='gotoMangerOrg()'>组织机构管理</a><a href='CollOrgManger.aspx'>刷新</a></div></li>");

            }
            litChnl.Text = sb.ToString();

            //HR_DEPT objVal = new HR_DEPT();
            //HR_DEPT objCond = new HR_DEPT();
            //objCond.P_DEPT_ID = "0";
            //objVal.OrderBy(HR_DEPT.Attribute.SORT_NO, Order.Asc);
            //List<HR_DEPT> lstChnl = BLLTable<HR_DEPT>.Factory(conn).Select(objVal,objCond);
            //StringBuilder sb = new StringBuilder();
            //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 == 0)
            //        //{
            //        //    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].SORT_NO.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 class='node_dept'></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>");

            //}
            //litChnl.Text = sb.ToString();
        }
    }
Пример #26
0
 private void BindList(HR_ORG condObj, int curPage)
 {
     if (condObj.af_PageByAttributeItem == null)//����������û�����ķ�ҳ�������ԣ�����������������
         condObj.af_PageBy(HR_ORG.Attribute.ORG_ID, Order.Desc);
     listObj = BLLTable<HR_ORG>.Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, curPage, ref recount);
     repList.DataSource = listObj;
     repList.DataBind();
     aspPager.RecordCount = recount;
 }
Пример #27
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();
        }
    }
    private void BindList(HR_CHECKWORKDEVICE condObj, int curPage)
    {
        if (condObj.af_PageByAttributeItem == null)//����������û�����ķ�ҳ�������ԣ�����������������
            condObj.af_PageBy(HR_CHECKWORKDEVICE.Attribute.DeviceID, Order.Desc);

        #region//����Ȩ������

        #endregion
        //condObj.PID = decimal.Parse(pid);
        HR_ORG orgVal = new HR_ORG();
        orgVal._ORG_NAME = "";
        Relation rt = new Relation(HR_CHECKWORKDEVICE.Attribute.ORG_ID, HR_ORG.Attribute.ORG_ID);

        listObj = BLLTable<HR_CHECKWORKDEVICE>.Factory(conn).SelectByPage(valObj, rt, orgVal, condObj, aspPager.PageSize, curPage, ref recount);
        repList.DataSource = listObj;
        repList.DataBind();
        aspPager.RecordCount = recount;
    }
Пример #29
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();
    }
Пример #30
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Title = title;
        if (!IsPostBack)
        {
            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);

            StringBuilder sb = new StringBuilder();
            if (lstChnl.Count > 0)
            {
                sb.Append("<li id=\"root_0\" data=\"{id:'0',pid:'0',sc:0,name:'组织机构管理',ntype:'root'}\" class=\"root\" exp='2'><div class=\"opened root\"><b></b><em></em><a href=\"#\" onclick='gotoMangerOrg()'>组织机构管理</a><a href='CollOrgManger.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 = 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:'root'}\" class=\"root\"><div class='root'><b></b><em></em><a href=\"#\" onclick='gotoMangerOrg()'>组织机构管理</a><a href='CollOrgManger.aspx'>刷新</a></div></li>");
            }
            litChnl.Text = sb.ToString();

            //HR_DEPT objVal = new HR_DEPT();
            //HR_DEPT objCond = new HR_DEPT();
            //objCond.P_DEPT_ID = "0";
            //objVal.OrderBy(HR_DEPT.Attribute.SORT_NO, Order.Asc);
            //List<HR_DEPT> lstChnl = BLLTable<HR_DEPT>.Factory(conn).Select(objVal,objCond);
            //StringBuilder sb = new StringBuilder();
            //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 == 0)
            //        //{
            //        //    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].SORT_NO.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 class='node_dept'></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>");

            //}
            //litChnl.Text = sb.ToString();
        }
    }
Пример #31
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();
        }
    }
Пример #32
0
    protected void Page_Load(object sender, EventArgs e)
    {
        title = valObj._ZhName + "�༭";
        Page.Title = title;
        if (!string.IsNullOrEmpty(Request["KeyID"]))
        {
            keyid = Request["KeyID"];
        }
        if (!string.IsNullOrEmpty(Request["ORG_ID"]))
        {
            keyid = Request["ORG_ID"];
        }
        if (!string.IsNullOrEmpty(Request["PID"]))
        {
            pid = Request["PID"];
        }
        if (!IsPostBack)
        {
            try
            {
                if (keyid != "")
                {

                    valObj = BLLTable<HR_ORG>.Factory(conn).GetRowData(HR_ORG.Attribute.ORG_ID, keyid);
                    if (valObj == null) return;

                    txtSortNum.Value = valObj.SORT_NO.ToString();
                    txtORG_ID.Value = Convert.ToString(valObj.ORG_ID);//Convert.ToString

                    txtORG_NAME.Value = Convert.ToString(valObj.ORG_NAME);//Convert.ToString

                    wucSelORG1.ORG_ID = Convert.ToString(valObj.P_ORG_ID);//Convert.ToString
                    wucSelORG1.Enabled = false;
                    //wucSelORG1.ORG_NAME = BLLTable<HR_ORG>.Factory(conn).GetOneValue(HR_ORG.Attribute.ORG_ID, valObj.P_ORG_ID, HR_ORG.Attribute.ORG_NAME);

                    txtSNAME.Value = Convert.ToString(valObj.SNAME);//Convert.ToString

                    txtRNAME.Value = Convert.ToString(valObj.RNAME);//Convert.ToString

                    txtEXP1.Value = Convert.ToString(valObj.EXP1);//Convert.ToString

                    txtEXP2.Value = Convert.ToString(valObj.EXP2);//Convert.ToString

                    txtEXP3.Value = Convert.ToString(valObj.EXP3);//Convert.ToString

                    wucSelORG1.Enabled = false;
                }
                else {
                    if (pid != "" && pid != "0")
                    {
                        wucSelORG1.ORG_ID = pid ;//Convert.ToString
                        wucSelORG1.Enabled = false;
                    }
                }
            }
            catch (Exception ex)
            {
                litWarn.Text = ex.Message;
            }
        }
    }
Пример #33
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();
        }
    }
Пример #34
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();
        }
    }