Example #1
0
        public DataTable SelectC_User(int rowcount, int pageindex, string emp_no, OleExec DB, DB_TYPE_ENUM DBType)
        {
            string    strSql = (emp_no == "" ? $@"select * from c_user order by  edit_time  " : $@"select *from c_user  where (factory,bu_name,dpt_name ) in (select factory, bu_name, dpt_name from c_user    where emp_no = '{emp_no}')");
            DataTable res    = DB.ExecSelect_b(rowcount, pageindex, strSql);

            return(res);
        }
Example #2
0
        public List <c_user_model> SelectUserInfo(int rowcount, int pageindex, string SearchEmp, string EmpLevel, string DptName, string LoginEmp, string Factory, string Bu, OleExec DB)
        {
            string              strSql       = string.Empty;
            DataTable           dt           = new DataTable();
            List <c_user_model> UsetInfolsit = new List <c_user_model>();

            if (EmpLevel == "9") //9级用户取到本厂别所有部门的用户信息
            {
                strSql = (SearchEmp == "" ? $@" select * from c_user where factory='{Factory}' order by  edit_time  " : $@" select * from c_user    where factory='{Factory}' and  emp_no like '%{SearchEmp}%' order by  edit_time ");
            }
            else if (EmpLevel == "1")  //1级用户取到本厂别本部门 的用户信息
            {
                strSql = (SearchEmp == "" ? $@" select * from c_user where factory='{Factory}' and bu_name='{Bu}' and  dpt_name='{DptName}' order by  edit_time  " : $@" select * from c_user    where emp_no like '%{SearchEmp}%' and  factory='{Factory}' and bu_name='{Bu}' and  dpt_name='{DptName}' order by  edit_time ");
            }
            else if (EmpLevel == "0") //0级用户取到本人 的用户信息
            {
                strSql = $@" select * from c_user where emp_no like '%{LoginEmp}%' order by  edit_time  ";
            }
            else
            {
                return(UsetInfolsit);
            }
            dt = DB.ExecSelect_b(rowcount, pageindex, strSql);
            foreach (DataRow item in dt.Rows)
            {
                UsetInfolsit.Add(new c_user_model
                {
                    ID            = item["ID"].ToString(),
                    FACTORY       = item["FACTORY"].ToString(),
                    BU_NAME       = item["BU_NAME"].ToString(),
                    EMP_NO        = item["EMP_NO"].ToString(),
                    EMP_NAME      = item["EMP_NAME"].ToString(),
                    EMP_PASSWORD  = item["EMP_PASSWORD"].ToString(),
                    EMP_LEVEL     = item["EMP_LEVEL"].ToString(),
                    DPT_NAME      = item["DPT_NAME"].ToString(),
                    POSITION_NAME = item["POSITION_NAME"].ToString(),
                    MAIL_ADDRESS  = item["MAIL_ADDRESS"].ToString(),
                    PHONE_NUMBER  = item["PHONE_NUMBER"].ToString(),
                    LOCATION      = item["LOCATION"].ToString(),
                    LOCK_FLAG     = item["LOCK_FLAG"].ToString(),
                    AGENT_EMP_NO  = item["AGENT_EMP_NO"].ToString(),
                    EMP_DESC      = item["EMP_DESC"].ToString(),
                    EDIT_EMP      = item["EDIT_EMP"].ToString(),
                    EMP_EN_NAME   = item["EMP_EN_NAME"].ToString()
                });
            }
            return(UsetInfolsit);
        }