Esempio n. 1
0
 /// <summary>
 /// 获取工厂时间—WDATE、SHT、BAN、STIME、ETIME
 /// </summary>
 /// <returns></returns>
 public DataTable GetShift()
 {
     try
     {
         string strSql = "GETSHIFT";
         return(db.ExecuteDataTable(strSql));
     }
     catch { throw; }
 }
Esempio n. 2
0
        /// <summary>
        /// 获取菜单权限数据
        /// </summary>
        /// <param name="loginName"></param>
        /// <returns></returns>
        public DataTable GetPermissions(string loginName)
        {
            try
            {
                string strSql = string.Format(@" 
SELECT 
DISTINCT  C.Id,C.DisplayName,C.NodeURL,C.DisplayOrder,C.ParentNodeId,C.MenuLevel,C.FunImgNum,C.Editor,C.CreateDate  
FROM T_MOBILE_GROUP (NOLOCK) AS A LEFT JOIN T_MOBILE_PERMISSIONS (NOLOCK) AS B ON A.GroupId = B.GroupId
LEFT JOIN T_MOBILE_MENU (NOLOCK) AS C ON B.MobileMenuId = C.Id WHERE A.LOGINNAME = '{0}' AND MenuLevel = '2' AND (C.NodeURL <> '' AND C.NodeURL IS NOT NULL)
ORDER BY C.DISPLAYORDER ASC ", loginName);
                return(db.ExecuteDataTable(strSql));
            }
            catch { throw; }
        }
Esempio n. 3
0
        public IList <T> ExecuteStoredProcedure <T>(ISession session, string storedProcName, SqlParameter[] parameters, out int recordCount, bool keepSession) where T : new()
        {
            try
            {
                OpenConnect();
                DataTable dt   = MsSqlHelper.ExecuteDataTable(session.Connection as SqlConnection, CommandType.StoredProcedure, storedProcName, parameters);
                IList <T> list = JF.Common.Libary.ModelFunc.ModelConvertHelper <T> .ToList(dt);

                if (list == null)
                {
                    recordCount = 0;
                    return(null);
                }
                recordCount = list.Count;
                return(list);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (!keepSession)
                {
                    Disconnect();
                }
            }
        }
Esempio n. 4
0
 /// <summary>
 /// 获取语言
 /// </summary>
 /// <param name="key"></param>
 /// <returns></returns>
 public DataTable GetLanguage()
 {
     try
     {
         string sql = " SELECT Chinese,English,Other FROM TranslationConfig (NOLOCK) WHERE Other != ''";
         return(db.ExecuteDataTable(sql));
     }
     catch
     {
         throw;
     }
 }
Esempio n. 5
0
 public bool ExecuteStoredProcedure(ISession session, string storedProcName, SqlParameter[] parameters, bool keepSession)
 {
     try
     {
         OpenConnect();
         MsSqlHelper.ExecuteDataTable(session.Connection as SqlConnection, CommandType.StoredProcedure, storedProcName, parameters);
         return(true);
     }
     catch (Exception ex)
     {
         LogExepttion(ex);
         return(false);
     }
     finally
     {
         if (!keepSession)
         {
             Disconnect();
         }
     }
 }
Esempio n. 6
0
        public DataTable GetFixedAssetInfo(string strDepartment, string index = "0")
        {
            try
            {
                string strSql = string.Format(@"
                                                SELECT a.BARCODE,
                                                       a.ASSETCODE,
                                                       a.ASSETNAME,
                                                       a.GUIGEXINGHAO,
                                                       right('00'+a.ZICHANZHUANGTAI,2) ZICHANZHUANGTAI,
                                                       zczt.ZHUANGTAIMINGCHENG,
                                                       a.CUNFANGDIDIAN,
                                                       cfdept.DEPTNAME CUNFANGDIDIANNAME,
                                                       a.SHIYONGBUMEN,
                                                       dept.DEPTNAME SHIYONGBUMENNAME,
                                                       a.GUYUANBIANHAO,
                                                       emp.EMPLOYEENAME,
                                                       a.ZICHANSHIBEIMA,
                                                       a.XULIEHAO,
                                                       a.BEIZHU
                                                FROM FIXEDASSETINFO a
                                                left join ZICHANZHUANGTAI zczt on right('00'+a.ZICHANZHUANGTAI,2)= zczt.ZHUANGTAICODE --資產狀態
                                                left join DEPARTMENTINFO dept on  a.SHIYONGBUMEN=dept.DEPTCODE --使用部門
                                                left join DEPARTMENTINFO cfdept on a.CUNFANGDIDIAN=cfdept.DEPTCODE --存放部門
                                                left join EMPLOYEEINFO emp on a.GUYUANBIANHAO=emp.EMPLOYEECODE --僱員姓名
                                                WHERE 1 = 1 AND DATAFLAG = 0 AND BARCODE ! = ''
                                                and ADMINDEPT = '{0}'
                                                ", strDepartment);
                if (strDepartment == "全部")
                {
                    strSql =
                        @"SELECT a.BARCODE,
                        a.ASSETCODE,
                        a.ASSETNAME,
                        a.GUIGEXINGHAO,
                        right('00'+a.ZICHANZHUANGTAI,2) ZICHANZHUANGTAI,
                        zczt.ZHUANGTAIMINGCHENG,
                        a.CUNFANGDIDIAN,
                        cfdept.DEPTNAME CUNFANGDIDIANNAME,
                        a.SHIYONGBUMEN,
                        dept.DEPTNAME SHIYONGBUMENNAME,
                        a.GUYUANBIANHAO,
                        emp.EMPLOYEENAME,
                        a.ZICHANSHIBEIMA,
                        a.XULIEHAO,
                        a.BEIZHU
                        FROM FIXEDASSETINFO a
                        left join ZICHANZHUANGTAI zczt on right('00'+a.ZICHANZHUANGTAI,2)= zczt.ZHUANGTAICODE --資產狀態
                        left join DEPARTMENTINFO dept on  a.SHIYONGBUMEN=dept.DEPTCODE --使用部門
                        left join DEPARTMENTINFO cfdept on a.CUNFANGDIDIAN=cfdept.DEPTCODE --存放部門
                        left join EMPLOYEEINFO emp on a.GUYUANBIANHAO=emp.EMPLOYEECODE --僱員姓名
                        WHERE 1 = 1 AND DATAFLAG = 0 AND BARCODE ! = ''
";
                }
                if (index == "test")
                {
                    strSql =
                        @" SELECT a.BARCODE,    
                                    a.ASSETCODE,
                                    a.ASSETNAME,
                                    a.GUIGEXINGHAO,
                                    right('00'+a.ZICHANZHUANGTAI,2) ZICHANZHUANGTAI,
                                    zczt.ZHUANGTAIMINGCHENG,
                                    a.CUNFANGDIDIAN,
                                    cfdept.DEPTNAME CUNFANGDIDIANNAME,
                                    a.SHIYONGBUMEN,
                                    dept.DEPTNAME SHIYONGBUMENNAME,
                                    a.GUYUANBIANHAO,
                                    emp.EMPLOYEENAME,
                                    a.ZICHANSHIBEIMA,
                                    a.XULIEHAO,
                                    a.BEIZHU
                                    FROM FIXEDASSETINFO a
                                    left join ZICHANZHUANGTAI zczt on right('00'+a.ZICHANZHUANGTAI,2)= zczt.ZHUANGTAICODE --資產狀態
                                    left join DEPARTMENTINFO dept on  a.SHIYONGBUMEN=dept.DEPTCODE --使用部門
                                    left join DEPARTMENTINFO cfdept on a.CUNFANGDIDIAN=cfdept.DEPTCODE --存放部門
                                    left join EMPLOYEEINFO emp on a.GUYUANBIANHAO=emp.EMPLOYEECODE --僱員姓名
                                    WHERE 1 = 1 AND DATAFLAG = 0 AND BARCODE ! = ''
                                    and BARCODE='830000100'";
                }
                //FixedAssetInfoModel model = new FixedAssetInfoModel();
                return(db.ExecuteDataTable(strSql));
            }
            catch { throw; }
            //return new FixedAssetInfoModel();
        }