Пример #1
0
        /// <summary>
        /// 得到角色菜单信息
        /// </summary>
        /// <returns></returns>
        public static DataTable getMenuInfo(long RoleId)
        {
            DataService.DataService dCurService = new Jin.DataService.DataService();
            string sql = "SELECT c.NODEID, c.text FROM ROLE_MENU b,menu c WHERE b.ROLE_ID = " + RoleId + "and b.NODEID = c.NODEID and c.TREELEVEL=2 Order By c.NODEID";

            return(dCurService.GetOleTable(sql));
        }
Пример #2
0
        /// <summary>
        /// 查询菜单树
        /// </summary>
        /// <param name="RoleId"></param>
        /// <returns></returns>
        public static DataSet GetMenu(long RoleId)
        {
            string sql = "SELECT a.ROLE_ID,a.Description, c.* FROM role a ,ROLE_MENU b,menu c WHERE a.ROLE_ID = " + RoleId + "and a.ROLE_ID = b.ROLE_ID and b.NODEID = c.NODEID Order By PARENTID,c.ORDERID";

            DataService.DataService dService = new Jin.DataService.DataService();
            return(dService.GetOleDataset(sql));
        }
Пример #3
0
        /// <summary>
        /// 判断角色名是否存在
        /// </summary>
        /// <param name="roleName"></param>
        /// <returns></returns>
        public static bool IsRolename(string roleName)
        {
            bool   bSeced = false;
            long   count  = 0;
            string strSql = string.Format("Select count(*) From role Where role_Name='{0}'", roleName);

            Jin.DataService.DataService dService = new Jin.DataService.DataService();

            object obj = dService.GetValue(strSql.ToString());

            if (obj != null && !string.IsNullOrEmpty(obj.ToString().Trim()))
            {
                count = Convert.ToInt32(obj.ToString().Trim());
                if (count >= 1)
                {
                    bSeced = true;
                }
                else
                {
                    bSeced = false;
                }
            }

            return(bSeced);
        }
Пример #4
0
        public static DataTable gettable(string t)
        {
            DataService.DataService dCurService = new Jin.DataService.DataService();

            string strSql = "select   * FROM " + t + " ";

            return(dCurService.GetOleTable(strSql));
        }
Пример #5
0
        public static DataTable GetSBinform2(string SB_ID)
        {
            DataService.DataService dCurService = new Jin.DataService.DataService();

            string strSql = "select * FROM SB_INFOR where SB_ID='" + SB_ID + "'";

            return(dCurService.GetOleTable(strSql));
        }
Пример #6
0
        public static DataTable GetCRKJLinform(string Filter)
        {
            DataService.DataService dCurService = new Jin.DataService.DataService();

            string strSql = "select * FROM BJCRJL where (" + Filter + ")";

            return(dCurService.GetOleTable(strSql));
        }
Пример #7
0
        public static DataTable getPJInfo(string KC, string Filter, string PX)
        {
            DataService.DataService dCurService = new Jin.DataService.DataService();

            string strSql = "select  * FROM 井开次效益汇总     where 开次='" + KC + "' and " + Filter + " order by " + PX + "  ";

            return(dCurService.GetOleTable(strSql));
        }
Пример #8
0
        /// <summary>
        /// 得到角色信息
        /// </summary>
        /// <param name="strSql"></param>
        /// <returns></returns>
        public static DataTable getDtRoleInfo(long roleid)
        {
            DataService.DataService dCurService = new Jin.DataService.DataService();

            string strSql = string.Format("select ROLE_ID,role_name from role where ROLE_ID=" + roleid);

            return(dCurService.GetOleTable(strSql));
        }
Пример #9
0
        /// <summary>
        /// 得到当前用户表姓名或用户名相同的记录表
        /// </summary>
        /// <param name="strSql"></param>
        /// <returns></returns>
        public static DataTable getUsersInfo(string szFilter)
        {
            DataService.DataService dCurService = new Jin.DataService.DataService();

            string strSql = "SELECT USER_INFOR.*, USER_ROLE.ROLE_ID, ROLE.ROLE_NAME FROM (USER_INFOR LEFT JOIN USER_ROLE ON USER_INFOR.USER_ID = USER_ROLE.USER_ID) LEFT JOIN ROLE ON USER_ROLE.ROLE_ID = ROLE.ROLE_ID  WHERE (" + szFilter + ") ";

            return(dCurService.GetOleTable(strSql));
        }
Пример #10
0
        /// <summary>
        /// 得到角色信息
        /// </summary>
        /// <param name="strSql"></param>
        /// <returns></returns>
        public static DataTable getDtRoleInfo()
        {
            DataService.DataService dCurService = new Jin.DataService.DataService();

            string strSql = string.Format("select ROLE_ID,role_name from role order by ROLE_ID");

            return(dCurService.GetOleTable(strSql));
        }
Пример #11
0
        /// <summary>
        /// 读取用户信息
        /// </summary>
        /// <param name="?"></param>
        /// <returns></returns>
        public static DataTable getCurUserInfo(string UserName)
        {
            DataService.DataService dCurService = new Jin.DataService.DataService();

            string strSql = "select * FROM USER_infor where user_name='" + UserName + "'";

            return(dCurService.GetOleTable(strSql));
        }
Пример #12
0
        /// <summary>
        /// 读取单位信息
        /// </summary>
        /// <param name="?"></param>
        /// <returns></returns>
        public static DataTable getBMInfo(string BM_Name)
        {
            DataService.DataService dCurService = new Jin.DataService.DataService();

            string strSql = "select * FROM department where bm_name='" + BM_Name + "'";

            return(dCurService.GetOleTable(strSql));
        }
Пример #13
0
        /// <summary>
        /// 得到菜单信息
        /// </summary>
        /// <param name="strSql"></param>
        /// <returns></returns>
        public static DataTable getMenuInfo()
        {
            DataService.DataService dCurService = new Jin.DataService.DataService();

            string strSql = "select NODEID,TEXT  from menu where TREELEVEL=2  ORDER BY NODEID";

            return(dCurService.GetOleTable(strSql));
        }
Пример #14
0
        public static DataTable getPJInfo(string Filter, string PX)
        {
            DataService.DataService dCurService = new Jin.DataService.DataService();

            string strSql = "select  * FROM 井效益钻速汇总     where (" + Filter + ") order by " + PX + " ";

            return(dCurService.GetOleTable(strSql));
        }
Пример #15
0
        public static DataTable GETtableXYk(double x, double Y, int K)
        {
            DataService.DataService dCurService = new Jin.DataService.DataService();

            string strSql = string.Format("Select *  FROM 井坐标 where X<" + x + "+" + K + " AND  X>" + x + "-" + K + "  AND Y<" + Y + "+" + K + " AND Y>" + Y + "-" + K + "  ");



            return(dCurService.GetOleTable(strSql));
        }
Пример #16
0
        public static DataTable GETDCSD(string t)
        {
            DataService.DataService dCurService = new Jin.DataService.DataService();

            string strSql = string.Format("Select *  FROM 井深地层信息 where 井号 in (" + t + " ) ");



            return(dCurService.GetOleTable(strSql));
        }
Пример #17
0
        /// <summary>
        ///    添加单位信息
        /// </summary>
        /// <param name="BM_fzr"></param>
        /// <param name="BM_tel"></param>
        /// <param name="BM_JS"></param>
        /// <param name="BM_Name"></param>
        /// <returns></returns>

        public static bool AddDEPInfo(string BM_fzr, string BM_tel, string BM_JS, string BM_Name)
        {
            DataService.DataService dCurService = new Jin.DataService.DataService();

            string strSql = "insert into department (bm_name,BM_fzr, BM_tel,BM_JS) values('" + BM_Name + "','" + BM_fzr + "','" + BM_tel + "', '" + BM_JS + "')";

            bool bSuced = false;

            bSuced = dCurService.ExecOleSql(strSql);
            return(bSuced);
        }
Пример #18
0
        /// <summary>
        /// 角色增加
        /// </summary>
        /// <param name="szUserCode"></param>
        /// <param name="szRole"></param>
        /// <returns></returns>
        public static bool AddRole(string roleName)
        {
            bool   bSeced = false;
            string strSql = string.Format("Insert Into role(Role_name) Values('{0}')", roleName);

            Jin.DataService.DataService dService = new Jin.DataService.DataService();

            bSeced = dService.ExecOleSql(strSql);

            return(bSeced);
        }
Пример #19
0
        /// <summary>
        /// 授权用户角色
        /// </summary>
        /// <param name="strSql"></param>
        /// <returns></returns>
        public static bool GrantUserRole(long uid, string UserName, long RoleId)
        {
            DataService.DataService dCurService = new Jin.DataService.DataService();

            string strSql = string.Format("insert into user_role (user_id,username,ROLE_ID) values ({0},'{1}',{2})", uid, UserName, RoleId);

            bool bSuced = false;

            bSuced = dCurService.ExecOleSql(strSql);
            return(bSuced);
        }
Пример #20
0
        /// <summary>
        /// 更新单位信息
        /// </summary>
        /// <param name="BM_fzr"></param>
        /// <param name="BM_tel"></param>
        /// <param name="BM_JS"></param>
        /// <param name="BM_Name"></param>
        /// <returns></returns>
        public static bool UpdateDEPInfo(string BM_fzr, string BM_tel, string BM_JS, string BM_Name)
        {
            DataService.DataService dCurService = new Jin.DataService.DataService();

            string strSql = "update department set BM_fzr='" + BM_fzr + "', BM_tel='" + BM_tel + "', BM_JS='" + BM_JS + "' where bm_name='" + BM_Name + "'";

            bool bSuced = false;

            bSuced = dCurService.ExecOleSql(strSql);
            return(bSuced);
        }
Пример #21
0
        /// <summary>
        /// 删除用户选中的权限
        /// </summary>
        /// <param name="szUserCode"></param>
        /// <param name="szRole"></param>
        /// <returns></returns>
        public static bool DelRoleMenu(long RoleId, long MenuId)
        {
            bool   bSeced = false;
            string strSql = "delete from ROLE_MENU where ROLE_ID =" + RoleId + " and NODEID =" + MenuId;

            Jin.DataService.DataService dService = new Jin.DataService.DataService();

            bSeced = dService.ExecOleSql(strSql);

            return(bSeced);
        }
Пример #22
0
        /// <summary>
        /// 授予用户选中的权限
        /// </summary>
        /// <param name="szUserCode"></param>
        /// <param name="szRole"></param>
        /// <returns></returns>
        public static bool AddRoleMenu(long RoleId, long MenuId)
        {
            bool   bSeced = false;
            string strSql = string.Format("Insert Into role_menu(ROLE_ID,NODEID) Values({0},{1})", RoleId, MenuId);

            Jin.DataService.DataService dService = new Jin.DataService.DataService();

            bSeced = dService.ExecOleSql(strSql);

            return(bSeced);
        }
Пример #23
0
        public static bool UpdateUserrole(long szUserCode, string szUserName, long RoleId)
        {
            DataService.DataService dCurService = new Jin.DataService.DataService();

            string strSql = string.Format("Update  user_role set username='******',ROLE_ID={2} where user_id={0}", szUserCode, szUserName, RoleId);

            bool bSuced = false;

            bSuced = dCurService.ExecOleSql(strSql);
            return(bSuced);
        }
Пример #24
0
        /// <summary>
        /// 执行一条SQL 语句
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        public static bool ControlRole(string sql)
        {
            DataService.DataService dCurService = new Jin.DataService.DataService();

            string strSql = string.Format(sql);

            bool bSuced = false;

            bSuced = dCurService.ExecOleSql(strSql);
            return(bSuced);
        }
Пример #25
0
        /// <summary>
        /// 读取设备基本信息
        /// </summary>
        /// <returns></returns>
        public static DataTable GetSBinform(long count, long page)
        {
            DataService.DataService dCurService = new Jin.DataService.DataService();
            long   count2 = (page - 1) * count;
            string strSql = "select top " + count + " * FROM SB_INFOR  order by 行号";

            if (page > 1)
            {
                strSql = "select top " + count + " * FROM SB_INFOR  where 行号>(select max(行号) from(select top " + count2 + " 行号 FROM SB_INFOR  order by 行号)) order by 行号  ";
            }

            return(dCurService.GetOleTable(strSql));
        }
Пример #26
0
        /// <summary>
        /// 读取井信息
        /// </summary>
        /// <param name="?"></param>
        /// <returns></returns>

        public static DataTable getJBBXXInfo(long count, long page)
        {
            DataService.DataService dCurService = new Jin.DataService.DataService();
            long   count2 = (page - 1) * count;
            string strSql = "select top " + count + " * FROM 井基本数据  order by 井号 ";

            if (page > 1)
            {
                strSql = "select top " + count + " * FROM 井基本数据  where 井号>(select max(井号) from(select top " + count2 + " 井号 FROM 井基本数据  order by 井号)) order by 井号  ";
            }

            return(dCurService.GetOleTable(strSql));
        }
Пример #27
0
        public static DataTable getJBBXXInfo(long count, long page, string Filter)
        {
            DataService.DataService dCurService = new Jin.DataService.DataService();
            long   count2 = (page - 1) * count;
            string strSql = "select top " + count + " * FROM 井漏数据   where (" + Filter + ") order by 编号";

            if (page > 1)
            {
                strSql = "select top " + count + " * FROM 井漏数据   where (" + Filter + ") and 编号>(select max(编号) from(select top " + count2 + " 编号 FROM 井漏数据 where (" + Filter + ") order by 编号)) order by 编号  ";
            }

            return(dCurService.GetOleTable(strSql));
        }
Пример #28
0
        public static long getJBBXXInfo(string Filter)
        {
            long   count  = 0;
            string strSql = string.Format("Select count(*) FROM 井漏数据 where (" + Filter + ")");

            Jin.DataService.DataService dService = new Jin.DataService.DataService();

            object obj = dService.GetValue(strSql.ToString());

            if (obj != null && !string.IsNullOrEmpty(obj.ToString().Trim()))
            {
                count = Convert.ToInt32(obj.ToString().Trim());
                return(count);
            }
            else
            {
                return(count);
            }
        }
Пример #29
0
        public static double getPJCBInfo()
        {
            double count  = 0;
            string strSql = string.Format("select AVG(单位进尺成本) FROM 井效益钻速汇总 ");

            Jin.DataService.DataService dService = new Jin.DataService.DataService();

            object obj = dService.GetValue(strSql.ToString());

            if (obj != null && !string.IsNullOrEmpty(obj.ToString().Trim()))
            {
                count = Convert.ToDouble(obj.ToString().Trim());
                return(count);
            }
            else
            {
                return(count);
            }
        }
Пример #30
0
        public static long getJSInfo()
        {
            long   count  = 0;
            string strSql = string.Format("select  count(*) FROM 井效益钻速汇总");

            Jin.DataService.DataService dService = new Jin.DataService.DataService();

            object obj = dService.GetValue(strSql.ToString());

            if (obj != null && !string.IsNullOrEmpty(obj.ToString().Trim()))
            {
                count = Convert.ToInt64(obj.ToString().Trim());
                return(count);
            }
            else
            {
                return(count);
            }
        }