Пример #1
0
        /// <summary>
        /// 获取LED设置
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        public static PositionLED GetLED(string sql)
        {
            DataSet     dataset = LinQBaseDao.Query(sql);
            PositionLED pLED    = new PositionLED();

            foreach (DataRow dr in dataset.Tables[0].Rows)
            {
                pLED.PositionLED_Position_ID  = int.Parse(dr["PositionLED_Position_Id"].ToString());
                pLED.PositionLED_Type         = int.Parse(dr["PositionLED_Type"].ToString());
                pLED.PositionLED_ID           = int.Parse(dr["PositionLED_ID"].ToString());
                pLED.PositionLED_ScreenHeight = int.Parse(dr["PositionLED_ScreenHeight"].ToString());
                pLED.PositionLED_ScreenWeight = int.Parse(dr["PositionLED_ScreenWeight"].ToString());
                pLED.PositionLED_X            = int.Parse(dr["PositionLED_X"].ToString());
                pLED.PositionLED_Y            = int.Parse(dr["PositionLED_Y"].ToString());
                //pLED.PositionLED_IntervalX = int.Parse(dr["PositionLED_IntervalX"].ToString());
                //pLED.PositionLED_IntervalY = int.Parse(dr["PositionLED_IntervalY"].ToString());
                pLED.PositionLED_Count   = int.Parse(dr["PositionLED_Count"].ToString());
                pLED.PositionLED_Remark  = dr["PositionLED_Remark"].ToString();
                pLED.PositionLED_Content = dr["PositionLED_Content"].ToString();
                //pLED.PositionLED_PassageState = dr["PositionLED_PassageState"].ToString();
                pLED.PositionLED_State    = dr["PositionLED_State"].ToString();
                pLED.PositionLED_Font     = dr["PositionLED_Font"].ToString();
                pLED.PositionLED_FontSize = dr["PositionLED_FontSize"].ToString();
                pLED.PositionLED_Color    = dr["PositionLED_Color"].ToString();
                pLED.PositionLED_Operate  = dr["PositionLED_Operate"].ToString();
                pLED.PositionLED_Time     = Convert.ToDateTime(dr["PositionLED_Time"].ToString());
            }
            return(pLED);
        }
Пример #2
0
        /// <summary>
        /// 查询可以显示的字段
        /// </summary>
        /// <param name="procName">存储过程名称</param>
        /// <param name="viewName">视图名称</param>
        /// <returns></returns>
        public static List <string> GetShow(string procName, string viewName)
        {
            List <string> list = new List <string>();

            list = LinQBaseDao.GetView(procName, viewName);
            return(list);
        }
Пример #3
0
        public static int LEDcount(string sql)
        {
            DataSet dscount = new DataSet();

            dscount = LinQBaseDao.Query(sql);
            return(Convert.ToInt32(dscount.Tables[0].Rows[0][0]));
        }
        /// <summary>
        /// 获取车辆类型
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        public static List <DeviceControl> GetDeviceControl(string sql)
        {
            DataSet dataset           = LinQBaseDao.Query(sql);
            List <DeviceControl> list = new List <DeviceControl>();

            if (dataset != null)
            {
                if (dataset.Tables.Count > 0)
                {
                    foreach (DataRow dr in dataset.Tables[0].Rows)
                    {
                        DeviceControl dcl = new DeviceControl();
                        dcl.DeviceControl_CardNo          = dr["DeviceControl_CardNo"].ToString();
                        dcl.DeviceControl_CardType        = dr["DeviceControl_CardType"].ToString();
                        dcl.DeviceControl_DrivewayAddress = dr["DeviceControl_DrivewayAddress"].ToString();
                        dcl.DeviceControl_DrivewayValue   = dr["DeviceControl_DrivewayValue"].ToString();
                        dcl.DeviceControl_FanSate         = dr["DeviceControl_FanSate"].ToString();
                        dcl.DeviceControl_FanValue        = dr["DeviceControl_FanValue"].ToString();
                        dcl.DeviceControl_ID            = int.Parse(dr["DeviceControl_ID"].ToString());
                        dcl.DeviceControl_ISCardRelease = Boolean.Parse(dr["DeviceControl_ISCardRelease"].ToString());
                        dcl.DeviceControl_OutSate       = dr["DeviceControl_OutSate"].ToString();
                        dcl.DeviceControl_PositionValue = dr["DeviceControl_PositionValue"].ToString();
                        dcl.DeviceControl_ReadValue     = dr["DeviceControl_ReadValue"].ToString();
                        dcl.DeviceControl_Remark        = dr["DeviceControl_Remark"].ToString();
                        list.Add(dcl);
                    }
                }
            }
            return(list);
        }
Пример #5
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="sql">查询sql语句</param>
        /// <returns></returns>
        public static DataSet GetCarType(string sql)
        {
            DataSet dataset = new DataSet();

            dataset = LinQBaseDao.Query(sql);
            return(dataset);
        }
 public static int MaxID(string sql)
 {
     try
     {
         return(Convert.ToInt32(LinQBaseDao.Query(sql).Tables[0].Rows[0][0]));
     }
     catch
     {
         return(0);
     }
 }
Пример #7
0
 /// <summary>
 /// 获取服务器时间
 /// </summary>
 /// <returns></returns>
 public static DateTime GetServersTime()
 {
     try
     {
         return(DateTime.Parse(LinQBaseDao.Query("select GETDATE()").Tables[0].Rows[0][0].ToString()));
     }
     catch
     {
         return(DateTime.Parse("1900-01-01 00:00:00.000"));
     }
 }
Пример #8
0
        /// <summary>
        /// Linq的更新方法
        /// </summary>
        /// <param name="fun">条件</param>
        /// <param name="action">修改的参数</param>
        public static void UpdateVoiceCalls(Expression <Func <VoiceCalls, bool> > fun, Action <VoiceCalls> action)
        {
            using (DCCarManagementDataContext dc = new DCCarManagementDataContext())
            {
                try
                {
                    LinQBaseDao.Update <VoiceCalls>(dc, fun, action);
                }

                finally { dc.Connection.Close(); }
            }
        }
        /// <summary>
        /// Linq根据条件删除数据
        /// </summary>
        /// <param name="fun"></param>
        public static void DeletePrintInfo(Expression <Func <PrintInfo, bool> > fun)
        {
            using (DCCarManagementDataContext dc = new DCCarManagementDataContext())
            {
                try
                {
                    LinQBaseDao.DeleteToMany <PrintInfo>(dc, fun);
                }

                finally { dc.Connection.Close(); }
            }
        }
        /// <summary>
        /// Linq的更新方法
        /// </summary>
        /// <param name="fun">条件</param>
        /// <param name="action">修改的参数</param>
        public static void UpdatePrint(Expression <Func <PrintInfo, bool> > fun, Action <PrintInfo> action)
        {
            using (DCCarManagementDataContext dc = new DCCarManagementDataContext())
            {
                try
                {
                    LinQBaseDao.Update <PrintInfo>(dc, fun, action);
                }

                finally { dc.Connection.Close(); }
            }
        }
Пример #11
0
        /// <summary>
        /// Linq根据条件删除数据
        /// </summary>
        /// <param name="fun"></param>
        public static void DeletePositionLED(Expression <Func <PositionLED, bool> > fun)
        {
            using (DCCarManagementDataContext db = new DCCarManagementDataContext())
            {
                try
                {
                    LinQBaseDao.DeleteToMany <PositionLED>(db, fun);
                }

                finally { db.Connection.Close(); }
            }
        }
 /// <summary>
 /// Linq的更新方法
 /// </summary>
 /// <param name="fun">条件</param>
 /// <param name="action">修改的参数</param>
 public static void UpdateDevice(Expression <Func <DeviceControl, bool> > fun, Action <DeviceControl> action)
 {
     using (DCCarManagementDataContext db = new DCCarManagementDataContext())
     {
         try
         {
             LinQBaseDao.Update <DeviceControl>(db, fun, action);
         }
         finally {
             db.Connection.Close();
         }
     }
 }
Пример #13
0
        /// <summary>
        /// 按条件删除多条数据
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="dc"></param>
        /// <param name="tentitys"></param>
        /// <param name="fun"></param>
        public static bool DeleteToMany(Expression <Func <SmallTicket, bool> > fun)
        {
            bool rbool = true;

            try
            {
                LinQBaseDao.DeleteToMany <SmallTicket>(new DCCarManagementDataContext(), fun);
            }
            catch
            {
                rbool = false;
            }
            return(rbool);
        }
        /// <summary>
        /// LINQ更新方法
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="dc"></param>
        /// <param name="fun"></param>
        /// <param name="tentity"></param>
        /// <param name="action"></param>
        public static bool Update(Expression <Func <ManagementStrategyRecord, bool> > fun, Action <ManagementStrategyRecord> action)
        {
            bool rbool = true;

            try
            {
                LinQBaseDao.Update <ManagementStrategyRecord>(new DCCarManagementDataContext(), fun, action);
            }
            catch
            {
                rbool = false;
            }
            return(rbool);
        }
        /// <summary>
        /// 按条件删除多条数据
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="dc"></param>
        /// <param name="tentitys"></param>
        /// <param name="fun"></param>
        public static bool DeleteToMany(Expression <Func <ManagementStrategyRecord, bool> > fun)
        {
            bool rbool = true;

            try
            {
                LinQBaseDao.DeleteToMany <ManagementStrategyRecord>(new DCCarManagementDataContext(), fun);
            }
            catch
            {
                rbool = false;
            }
            return(rbool);
        }
        /// <summary>
        /// 删除多条数据
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="dc"></param>
        /// <param name="tentitys"></param>
        public static bool DeleteToManyByCondition(IEnumerable <ManagementStrategyRecord> tentitys)
        {
            bool rbool = true;

            try
            {
                LinQBaseDao.DeleteToManyByCondition <ManagementStrategyRecord>(new DCCarManagementDataContext(), tentitys);
            }
            catch
            {
                rbool = false;
            }
            return(rbool);
        }
        /// <summary>
        /// 根据传入的sql进行验证
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        public static bool ChkPrintState(string sql)
        {
            DataSet dataset = new DataSet();

            dataset = LinQBaseDao.Query(sql);
            if (dataset.Tables[0].Rows.Count > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        /// <summary>
        /// 获取车辆类型
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        public static List <CarType> GetCarType(string sql)
        {
            DataSet        dataset = LinQBaseDao.Query(sql);
            List <CarType> list    = new List <CarType>();

            foreach (DataRow dr in dataset.Tables[0].Rows)
            {
                CarType cartype = new CarType();
                cartype.CarType_ID   = int.Parse(dr["CarType_ID"].ToString());
                cartype.CarType_Name = dr["CarType_Name"].ToString();
                list.Add(cartype);
            }
            return(list);
        }
        /// <summary>
        /// LINQ更新方法
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="dc"></param>
        /// <param name="fun"></param>
        /// <param name="tentity"></param>
        /// <param name="action"></param>
        public static bool Update(Expression <Func <Blacklist, bool> > fun, Action <Blacklist> action)
        {
            bool rbool = true;

            try
            {
                LinQBaseDao.Update <Blacklist>(new DCCarManagementDataContext(), fun, action);
            }
            catch
            {
                rbool = false;
            }
            return(rbool);
        }
        /// <summary>
        /// 获取设置
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        public static PrintInfo GetPrint(string sql)
        {
            DataSet   dataset = LinQBaseDao.Query(sql);
            PrintInfo pInfo   = new PrintInfo();

            foreach (DataRow dr in dataset.Tables[0].Rows)
            {
                pInfo.Print_CarType_ID = int.Parse(dr["Print_CarType_ID"].ToString());
                pInfo.Print_Content    = dr["Print_Content"].ToString();
                pInfo.Print_ID         = int.Parse(dr["Print_ID"].ToString());
                pInfo.Print_State      = dr["Print_State"].ToString();
            }
            return(pInfo);
        }
Пример #21
0
        /// <summary>
        /// 获取语音设置
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        public static VoiceCalls GetVoice(string sql)
        {
            DataSet    dataset = LinQBaseDao.Query(sql);
            VoiceCalls vc      = new VoiceCalls();

            foreach (DataRow dr in dataset.Tables[0].Rows)
            {
                vc.VoiceCalls_ID            = int.Parse(dr["VoiceCalls_ID"].ToString());
                vc.VoiceCalls_Number        = int.Parse(dr["VoiceCalls_Number"].ToString());
                vc.VoiceCalls_Content       = dr["VoiceCalls_Content"].ToString();
                vc.VoiceCalls_PositionName  = dr["VoiceCalls_PositionName"].ToString();
                vc.VoiceCalls_PositionValue = dr["VoiceCalls_PositionValue"].ToString();
                vc.VoiceCalls_Remark        = dr["VoiceCalls_Remark"].ToString();
            }
            return(vc);
        }
Пример #22
0
        /// <summary>
        /// 添加一条数据
        /// </summary>
        /// <param name="pLED">LED实体</param>
        /// <returns>返回执行结果 true or false</returns>
        public static bool InsertVoiceCalls(VoiceCalls vc)
        {
            bool rbool = false;

            using (DCCarManagementDataContext dc = new DCCarManagementDataContext())
            {
                try
                {
                    rbool = LinQBaseDao.InsertOne <VoiceCalls>(dc, vc);
                }
                catch
                {
                    rbool = false;
                }
                finally { dc.Connection.Close(); }
            }
            return(rbool);
        }
        /// <summary>
        /// 添加多条记录
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="dc"></param>
        /// <param name="tentitys"></param>
        public static bool InsertToMany(IEnumerable <ManagementStrategyRecord> tentitys)
        {
            bool rbool = true;

            using (DCCarManagementDataContext db = new DCCarManagementDataContext())
            {
                try
                {
                    LinQBaseDao.InsertToMany(db, tentitys);
                }
                catch
                {
                    rbool = false;
                }
                finally { db.Connection.Close(); }
            }
            return(rbool);
        }
        /// <summary>
        /// 新增一条记录
        /// </summary>
        /// <param name="qcRecord">质检实体</param>
        /// <returns></returns>
        public static bool InsertOneQCRecord(ManagementStrategyRecord qcRecord)
        {
            bool rbool = true;

            using (DCCarManagementDataContext db = new DCCarManagementDataContext())
            {
                try
                {
                    rbool = LinQBaseDao.InsertOne(db, qcRecord);
                }
                catch
                {
                    rbool = false;
                }
                finally { db.Connection.Close(); }
            }
            return(rbool);
        }
        /// <summary>
        /// 按条件删除多条数据
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="dc"></param>
        /// <param name="tentitys"></param>
        /// <param name="fun"></param>
        public static bool DeleteToMany(Expression <Func <Dictionary, bool> > fun)
        {
            bool rbool = true;

            using (DCCarManagementDataContext db = new DCCarManagementDataContext())
            {
                try
                {
                    LinQBaseDao.DeleteToMany <Dictionary>(new DCCarManagementDataContext(), fun);
                }
                catch
                {
                    rbool = false;
                }
                finally { db.Connection.Close(); }
            }
            return(rbool);
        }
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="pr">实体</param>
        /// <returns>返回执行结果 true or false</returns>
        public static bool InsertPrint(PrintRecord pr)
        {
            bool rbool = false;

            using (DCCarManagementDataContext dc = new DCCarManagementDataContext())
            {
                try
                {
                    rbool = LinQBaseDao.InsertOne <PrintRecord>(dc, pr);
                }
                catch
                {
                    rbool = false;
                }
                finally { dc.Connection.Close(); }
            }
            return(rbool);
        }
Пример #27
0
 /// <summary>
 /// 查询单条 返回实体
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="fun"></param>
 /// <returns></returns>
 public static MenuType Single(Expression <Func <MenuType, bool> > fun)
 {
     using (DCCarManagementDataContext db = new DCCarManagementDataContext())
     {
         try
         {
             return(LinQBaseDao.Single <MenuType>(db, fun));
         }
         catch
         {
             return(null);
         }
         finally
         {
             db.Connection.Close();
         }
     }
 }
Пример #28
0
        /// <summary>
        /// 新增一条记录
        /// </summary>
        /// <param name="qcRecord">实体</param>
        /// <returns></returns>
        public static bool InsertOneLogInfo(LogInfo loginfo)
        {
            bool rbool = true;

            using (DCCarManagementDataContext db = new DCCarManagementDataContext())
            {
                try
                {
                    rbool = LinQBaseDao.InsertOne(db, loginfo);
                }
                catch
                {
                    rbool = false;
                }
                finally { db.Connection.Close(); }
            }
            return(rbool);
        }
Пример #29
0
        public static bool DeleteMenuinfo(Expression <Func <MenuType, bool> > fun)
        {
            bool rbool = true;

            using (DCCarManagementDataContext db = new DCCarManagementDataContext())
            {
                try
                {
                    LinQBaseDao.DeleteToMany <MenuType>(db, fun);
                }
                catch
                {
                    rbool = false;
                }
                finally { db.Connection.Close(); }
                return(rbool);
            }
        }
        /// <summary>
        /// 新增一条记录
        /// </summary>
        /// <param name="qcRecord">质检实体</param>
        /// <returns></returns>
        public static bool InsertOneDevice(DeviceControl dcl)
        {
            bool rbool = true;

            using (DCCarManagementDataContext db = new DCCarManagementDataContext())
            {
                try
                {
                    rbool = LinQBaseDao.InsertOne(db, dcl);
                }
                catch
                {
                    rbool = false;
                }
                finally { db.Connection.Close(); }
            }
            return(rbool);
        }