Exemple #1
0
        /// <summary>
        /// Linq的更新方法
        /// </summary>
        /// <param name="fun">条件</param>
        /// <param name="action">修改的参数</param>
        public static void UpdatePositionLED(Expression <Func <PositionLED, bool> > fun, Action <PositionLED> action)
        {
            using (DCCarManagementDataContext db = new DCCarManagementDataContext())
            {
                try
                {
                    LinQBaseDao.Update <PositionLED>(db, fun, action);
                }

                finally { db.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(); }
            }
        }
Exemple #3
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>
 /// <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();
         }
     }
 }
        /// <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>
        /// 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);
        }
Exemple #7
0
        /// <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 <MenuType, bool> > fun, Action <MenuType> action)
        {
            bool rbool = true;

            using (DCCarManagementDataContext db = new DCCarManagementDataContext())
            {
                try
                {
                    LinQBaseDao.Update <MenuType>(db, fun, action);
                }
                catch
                {
                    rbool = false;
                }
                finally
                {
                    db.Connection.Close();
                }
                return(rbool);
            }
        }
Exemple #8
0
        /// <summary>
        /// 更新
        /// </summary>
        public static bool UpdateOneRoleInfo(Expression <Func <RoleInfo, bool> > fun, Action <RoleInfo> ap)
        {
            bool rbool = true;

            using (DCCarManagementDataContext db = new DCCarManagementDataContext())
            {
                try
                {
                    LinQBaseDao.Update <RoleInfo>(db, fun, ap);
                }
                catch
                {
                    return(rbool = false);
                }
                finally
                {
                    db.Connection.Close();
                }
            }
            return(rbool);
        }
Exemple #9
0
        /// <summary>
        /// Linq的更新方法
        /// </summary>
        /// <param name="fun">条件</param>
        /// <param name="action">修改的参数</param>
        public static bool UpdatePositionSMS(Expression <Func <PositionSMS, bool> > fun, Action <PositionSMS> action)
        {
            bool rbool = false;

            using (DCCarManagementDataContext dc = new DCCarManagementDataContext())
            {
                try
                {
                    if (LinQBaseDao.Update <PositionSMS>(dc, fun, action))
                    {
                        rbool = true;
                    }
                    else
                    {
                        rbool = false;
                    }
                }

                finally { dc.Connection.Close(); }
            }
            return(rbool);
        }
Exemple #10
0
 /// <summary>
 /// Linq的更新方法
 /// </summary>
 /// <param name="fun">条件</param>
 /// <param name="action">修改的参数</param>
 public static void UpdateUnusualRecord(Expression <Func <UnusualRecord, bool> > fun, Action <UnusualRecord> action)
 {
     LinQBaseDao.Update <UnusualRecord>(dc, fun, action);
 }