Пример #1
0
        /// <summary>
        /// 根據用戶等級獲取 部門信息
        /// </summary>
        /// <param name="requestValue"></param>
        /// <param name="Data"></param>
        /// <param name="StationReturn"></param>
        public void GetDepartmentListByEmpLevel(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn)
        {
            OleExec        sfcdb           = null;
            string         EmpLevel        = string.Empty;
            List <String>  DetpartmentList = new List <String>();
            T_C_DEPARTMENT detpartment;
            T_c_user       DptName;

            try
            {
                sfcdb       = this.DBPools["SFCDB"].Borrow();
                detpartment = new T_C_DEPARTMENT(sfcdb, DBTYPE);
                DptName     = new T_c_user(sfcdb, DBTYPE);
                if (LoginUser.EMP_LEVEL != "9" && LoginUser.EMP_LEVEL != "1")
                {
                    StationReturn.Status  = StationReturnStatusValue.Fail;
                    StationReturn.Message = "MES00000028";
                    StationReturn.Data    = "";
                    this.DBPools["SFCDB"].Return(sfcdb);
                }
                else
                {
                    if (LoginUser.EMP_LEVEL == "9")
                    {
                        DetpartmentList = detpartment.GetDepartment(sfcdb);
                    }
                    else if (LoginUser.EMP_LEVEL == "1")
                    {
                        DetpartmentList = DptName.GetDptName(LoginUser.EMP_NO, sfcdb);
                    }
                    StationReturn.Status  = StationReturnStatusValue.Pass;
                    StationReturn.Message = "MES00000001";
                    StationReturn.Data    = DetpartmentList;
                    this.DBPools["SFCDB"].Return(sfcdb);
                }
            }
            catch (Exception e)
            {
                this.DBPools["SFCDB"].Return(sfcdb);
                throw e;
            }
        }
Пример #2
0
        /// <summary>
        /// 獲取所有部門
        /// </summary>
        /// <param name="requestValue"></param>
        /// <param name="Data"></param>
        /// <param name="StationReturn"></param>
        public void GetDepartmentList(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn)
        {
            OleExec        sfcdb           = null;
            List <String>  DetpartmentList = new List <String>();
            T_C_DEPARTMENT detpartment;

            try
            {
                sfcdb                 = this.DBPools["SFCDB"].Borrow();
                detpartment           = new T_C_DEPARTMENT(sfcdb, DBTYPE);
                DetpartmentList       = detpartment.GetDepartment(sfcdb);
                StationReturn.Status  = StationReturnStatusValue.Pass;
                StationReturn.Message = "MES00000001";
                StationReturn.Data    = DetpartmentList;
                this.DBPools["SFCDB"].Return(sfcdb);
            }
            catch (Exception e)
            {
                this.DBPools["SFCDB"].Return(sfcdb);
                throw e;
            }
        }