• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# DAL.dbEcustomEntities类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ECustoms.DAL.dbEcustomEntities的典型用法代码示例。如果您正苦于以下问题:C# dbEcustomEntities类的具体用法?C# dbEcustomEntities怎么用?C# dbEcustomEntities使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



dbEcustomEntities类属于ECustoms.DAL命名空间,在下文中一共展示了dbEcustomEntities类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetAllVehicleNotCompleted

 public static List<ViewVehicleOverdue> GetAllVehicleNotCompleted()
 {
     var db = new dbEcustomEntities(Common.Decrypt(ConfigurationManager.ConnectionStrings["dbEcustomEntities"].ConnectionString, true));
     List<ViewVehicleOverdue> data = db.ViewVehicleOverdues.Where(g => g.IsCompleted != true).ToList();
     db.Connection.Close();
     return data;
 }
开发者ID:ViniciusConsultor,项目名称:ecustomsgs1,代码行数:7,代码来源:VehicleOvedueFactory.cs


示例2: GetPermissionByType

 public static List<tblPermission> GetPermissionByType(string type)
 {
     var db = new dbEcustomEntities(Common.Decrypt(ConfigurationManager.ConnectionStrings["dbEcustomEntities"].ConnectionString, true));
     List<tblPermission> list = db.tblPermissions.Where(g => g.TypeCode == type).ToList();
     db.Connection.Close();
     return list;
 }
开发者ID:ViniciusConsultor,项目名称:ecustomsgs1,代码行数:7,代码来源:PermissionFactory.cs


示例3: SelectByID

 public static ViewAllCheckResult SelectByID(int vehicleCheckID)
 {
     var db = new dbEcustomEntities(Common.Decrypt(ConfigurationManager.ConnectionStrings["dbEcustomEntities"].ConnectionString, true));
     ViewAllCheckResult  allCheckResult = db.ViewAllCheckResults.Where(g => g.VehicleCheckID == vehicleCheckID).FirstOrDefault();
     db.Connection.Close();
     return allCheckResult;
 }
开发者ID:ViniciusConsultor,项目名称:ecustomsgs1,代码行数:7,代码来源:VehicleCheckFactory.cs


示例4: GetTblUserInGroupByGroupID

 public static List<tblUserInGroup> GetTblUserInGroupByGroupID(int groupID)
 {
   var db = new dbEcustomEntities(Common.Decrypt(ConfigurationManager.ConnectionStrings["dbEcustomEntities"].ConnectionString, true));
   var userGroups = db.tblUserInGroups.Where(g => g.GroupID == groupID).ToList();
   db.Connection.Close();
   return userGroups;
 }
开发者ID:ViniciusConsultor,项目名称:ecustomsgs1,代码行数:7,代码来源:UserInGroupFactory.cs


示例5: Update

 public static int Update(tblVehicleType vehicletype)
 {
     var _db = new dbEcustomEntities(Common.Decrypt(ConfigurationManager.ConnectionStrings["dbEcustomEntities"].ConnectionString, true));
     _db.Connection.Open();
     var _vehicletype = (from vt in _db.tblVehicleTypes
                         where vt.VehicleTypeID == vehicletype.VehicleTypeID
                         select vt).First();
     _vehicletype.Name = vehicletype.Name;
     _vehicletype.Capacity = vehicletype.Capacity;
     _vehicletype.Description = vehicletype.Description;
     vehicletype.UpdatedDate = CommonFactory.GetCurrentDate();
     try
     {
         if (_db.Connection.State == ConnectionState.Closed) _db.Connection.Open();
         _db.SaveChanges();
     }
     catch (Exception ex)
     {
         return 1;
     }
     finally
     {
         if (_db.Connection.State == ConnectionState.Closed) _db.Connection.Open();
         _db.Connection.Close();
     }
     return 0;
 }
开发者ID:ViniciusConsultor,项目名称:ecustomsgs1,代码行数:27,代码来源:VehicleTypeFactory.cs


示例6: GetAllAllVehicleCompleted

        /// <summary>
        /// Hien lên những xe đã hoàn thành thủ tục và đã trả hồ sơ của ngày hiện tại
        /// </summary>
        /// <returns></returns>
        public static List<ViewAllVehicleHasGood> GetAllAllVehicleCompleted()
        {
            DateTime today = CommonFactory.GetCurrentDate();

            var startToday = new DateTime(today.Year, today.Month, today.Day, 0, 0, 0);
            var endToday = new DateTime(today.Year, today.Month, today.Day, 23, 59, 59);

            var db = new dbEcustomEntities(Common.Decrypt(ConfigurationManager.ConnectionStrings["dbEcustomEntities"].ConnectionString, true));
            //var data = db.ViewAllVehicleHasGoods.Where(g => g.ConfirmStatus != null && g.IsGoodsImported == true && g.IsCompleted == true && g.ConfirmDate >= startToday && g.ConfirmDate <= endToday).OrderByDescending(g => g.ImportDate).ToList();

            //tim cac xe da nhap canh co hang, nhung chua vao noi dia, va co to khai da xac nhan tra ho so, chi hien thi theo ngay tra so so = ngay hien tai
            List<ViewAllVehicleHasGood> data = db.ViewAllVehicleHasGoods.Where(g => g.HasGoodsImported == true && g.IsCompleted != true && g.ConfirmStatus != null && g.ConfirmDate >= startToday && g.ConfirmDate <= endToday).OrderByDescending(g => g.ConfirmDate).ToList();
            db.Connection.Close();
            List<ViewAllVehicleHasGood> list = new List<ViewAllVehicleHasGood>();
            HashSet<long> listVehicleId = new HashSet<long>();
            if (data != null && data.Count > 0)
            {
                foreach (ViewAllVehicleHasGood obj in data)
                {
                    if (listVehicleId.Add(obj.VehicleID))
                    {
                        list.Add(obj);
                    }
                }
            }

            return list;
        }
开发者ID:ViniciusConsultor,项目名称:ecustomsgs1,代码行数:32,代码来源:VehicleFactory.cs


示例7: Update

        public static int Update(tblType typeObj)
        {
            dbEcustomEntities _db = new dbEcustomEntities(Common.Decrypt(ConfigurationManager.ConnectionStrings["dbEcustomEntities"].ConnectionString, true));
            _db.Connection.Open();

            tblType originType = _db.tblTypes.Where(g => g.TypeCode == typeObj.TypeCode).FirstOrDefault();

            if (originType == null)
            {
                return -1;
            }

            originType.TypeName = typeObj.TypeName;
            originType.Description = typeObj.Description;
            originType.ModifiedBy = typeObj.ModifiedBy;
            originType.ModifiedDate = CommonFactory.GetCurrentDate();

            try
            {
                return _db.SaveChanges();
            }
            catch (Exception ex)
            {
                return -1;
            }
            finally
            {
                _db.Connection.Close();
            }
        }
开发者ID:ViniciusConsultor,项目名称:ecustomsgs1,代码行数:30,代码来源:TypeFactory.cs


示例8: DeleteItem

        public bool DeleteItem(string[] itemParams)
        {
            if (itemParams.Length < 3) return false;

            int id = itemParams[0].StringToInt();
            int verhiceId = itemParams[1].StringToInt();
            string branchId = itemParams[2];

            var _db = new dbEcustomEntities(Common.Decrypt(ConfigurationManager.ConnectionStrings["dbEcustomEntities"].ConnectionString, true));

            try
            {
                var deleteItem =
                    _db.tblDeclarationVehicles.FirstOrDefault(
                        item => item.DeclarationID == id && item.VehicleID == verhiceId && item.BranchId == branchId);
                if (deleteItem != null)
                {
                    _db.DeleteDirectly(deleteItem);
                    _db.SaveChanges();
                }

                return true;
            }
            catch (Exception exception)
            {
                LogManager.GetLogger("ECustoms.DeclarationVehicleFactory").Error(exception.ToString());
                throw;
            }
            finally
            {
                _db.Connection.Close();
            }
        }
开发者ID:ViniciusConsultor,项目名称:ecustomsgs1,代码行数:33,代码来源:DeclarationVehicleFactory.cs


示例9: DeleteByID

 /// <summary>
 /// Delete Decleration by ID
 /// </summary>
 /// <param name="declerationID">DeclerationID</param>
 /// <returns>Number of rows are effected</returns>
 public static int DeleteByID(int declerationID)
 {
     var db = new dbEcustomEntities(Utilities.Common.Decrypt(ConfigurationManager.ConnectionStrings["dbEcustomEntities"].ConnectionString, true));
     var declaration = db.tblDeclarations.Where(g => g.DeclarationID == declerationID).FirstOrDefault();
     db.DeleteObject(declaration);
     return db.SaveChanges();
 }
开发者ID:gsb123,项目名称:ecustoms-project,代码行数:12,代码来源:DeclarationFactory.cs


示例10: DeleteGroupByGroupID

        public static int DeleteGroupByGroupID(int groupID)
        {
          var db = new dbEcustomEntities(Common.Decrypt(ConfigurationManager.ConnectionStrings["dbEcustomEntities"].ConnectionString, true));
          
          var group = db.tblGroups.Where(g => g.GroupID == groupID).FirstOrDefault();

          if (group == null)
          {
            return 0;
          }

          //delete group
          db.DeleteObject(group);

          //delete group's users in tblUserInGroup
          List<tblUserInGroup> listTblUserInGroup = db.tblUserInGroups.Where(g => g.GroupID == groupID).ToList();
          foreach (tblUserInGroup userInGroup in listTblUserInGroup)
          {
            db.DeleteObject(userInGroup);
          }

          //delete group's permission in tblUserGroupPermistion
          List<tblUserGroupPermission> listUserGroupPermission = db.tblUserGroupPermissions.Where(g => g.GroupID == groupID && g.PermissionType == UserGroupPermissionFactory.PERMISSION_TYPE_GROUP).ToList();
          foreach (tblUserGroupPermission userGroupPermission in listUserGroupPermission)
          {
            db.DeleteObject(userGroupPermission);
          }

          int re = db.SaveChanges();
          db.Connection.Close();
          return re;
        }
开发者ID:ViniciusConsultor,项目名称:ecustomsgs1,代码行数:32,代码来源:GroupFactory.cs


示例11: GetCurrentDate

 public static DateTime GetCurrentDate()
 {
     var db = new dbEcustomEntities(Utilities.Common.Decrypt(ConfigurationManager.ConnectionStrings["dbEcustomEntities"].ConnectionString, true));
     var objCurentDate = db.ViewGetCurrentDates.FirstOrDefault();
     db.Connection.Close();
     return objCurentDate.CurrentDateTime;
 }
开发者ID:ViniciusConsultor,项目名称:ecustomsgs1,代码行数:7,代码来源:CommonFactory.cs


示例12: SelectVehicleCheckByID

 public static tblVehicleCheck SelectVehicleCheckByID(int vehicleCheckID)
 {
     var db = new dbEcustomEntities(Common.Decrypt(ConfigurationManager.ConnectionStrings["dbEcustomEntities"].ConnectionString, true));
     tblVehicleCheck vehicleCheck = db.tblVehicleChecks.Where(g => g.VehicleCheckID == vehicleCheckID).FirstOrDefault();
     db.Connection.Close();
     return vehicleCheck;
 }
开发者ID:ViniciusConsultor,项目名称:ecustomsgs1,代码行数:7,代码来源:VehicleCheckFactory.cs


示例13: GetTypeNameById

 public static string GetTypeNameById(int goodTypeId)
 {
     var db = new dbEcustomEntities(Common.Decrypt(ConfigurationManager.ConnectionStrings["dbEcustomEntities"].ConnectionString, true));
     var typeName = db.tblGoodsTypes.Where(g => g.TypeId == goodTypeId).Select(g=>g.TypeName).FirstOrDefault();
     db.Connection.Close();
     return typeName;
 }
开发者ID:ViniciusConsultor,项目名称:ecustomsgs1,代码行数:7,代码来源:GoodTypeFactory.cs


示例14: GetByUserID

 public static List<ViewUserGroup> GetByUserID(int userID)
 {
   var db = new dbEcustomEntities(Common.Decrypt(ConfigurationManager.ConnectionStrings["dbEcustomEntities"].ConnectionString, true));
   List<ViewUserGroup> list= db.ViewUserGroups.Where(g => g.UserID == userID).ToList();
   db.Connection.Close();
   return list;
 }
开发者ID:ViniciusConsultor,项目名称:ecustomsgs1,代码行数:7,代码来源:UserInGroupFactory.cs


示例15: GetAllPermissionType

 public static List<tblPermissionType> GetAllPermissionType()
 {
     var db = new dbEcustomEntities(Common.Decrypt(ConfigurationManager.ConnectionStrings["dbEcustomEntities"].ConnectionString, true));
     List<tblPermissionType> list = db.tblPermissionTypes.ToList();
     db.Connection.Close();
     return list;
 }
开发者ID:ViniciusConsultor,项目名称:ecustomsgs1,代码行数:7,代码来源:PermissionTypeFactory.cs


示例16: DeleteItem

        public bool DeleteItem(string[] itemParams)
        {
            if (itemParams.Length < 2) return false;

            string id = itemParams[0];
            string branchId = itemParams[1];

            var _db = new dbEcustomEntities(Common.Decrypt(ConfigurationManager.ConnectionStrings["dbEcustomEntities"].ConnectionString, true));

            try
            {
                var deleteItem =
                    _db.tblPermissionTypes.FirstOrDefault(
                        item => item.TypeCode == id && item.BranchId == branchId);
                if (deleteItem != null)
                {
                    _db.DeleteDirectly(deleteItem);
                    _db.SaveChanges();
                }

                return true;
            }
            catch (Exception exception)
            {
                LogManager.GetLogger("ECustoms.PermissionTypeFactory").Error(exception.ToString());
                throw;
            }
            finally
            {
                _db.Connection.Close();
            }
        }
开发者ID:ViniciusConsultor,项目名称:ecustomsgs1,代码行数:32,代码来源:PermissionTypeFactory.cs


示例17: BatchInsert

        public bool BatchInsert(object[] items)
        {
            var _db = new dbEcustomEntities(Common.Decrypt(ConfigurationManager.ConnectionStrings["dbEcustomEntities"].ConnectionString, true));

            try
            {
                _db.Connection.Open();
                foreach (object item in items)
                {
                    _db.AddObjectDirectly("tblProfileConfigs", item);
                }

                _db.SaveChanges();
                return true;
            }
            catch (Exception ex)
            {
                LogManager.GetLogger("ECustoms.AllFactory").Error(ex.ToString());
                throw;
            }
            finally
            {
                _db.Connection.Close();
            }

            return false;
        }
开发者ID:ViniciusConsultor,项目名称:ecustomsgs1,代码行数:27,代码来源:ProfileConfigFactory.cs


示例18: SelectAll

 public static List<ViewAllCheck> SelectAll()
 {
     var db = new dbEcustomEntities(Common.Decrypt(ConfigurationManager.ConnectionStrings["dbEcustomEntities"].ConnectionString, true));
     List < ViewAllCheck > list = db.ViewAllChecks.OrderByDescending(g => g.ModifedDate).ToList();
     db.Connection.Close();
     return list;
 }
开发者ID:ViniciusConsultor,项目名称:ecustomsgs1,代码行数:7,代码来源:CheckFactory.cs


示例19: SelectAll

 public static  List<tblGroup> SelectAll()
 {
     var db = new dbEcustomEntities(Common.Decrypt(ConfigurationManager.ConnectionStrings["dbEcustomEntities"].ConnectionString, true));
     List < tblGroup >  list = db.tblGroups.ToList();
     db.Connection.Close();
     return list;
 }
开发者ID:ViniciusConsultor,项目名称:ecustomsgs1,代码行数:7,代码来源:GroupFactory.cs


示例20: DeleteByID

 /// <summary>
 /// Delete vehicle by ID
 /// </summary>
 /// <param name="vehicleID">Vehicle ID</param>
 /// <returns>Number of rows are effected</returns>
 public static int DeleteByID(int vehicleID)
 {
     var db = new dbEcustomEntities(Utilities.Common.Decrypt(ConfigurationManager.ConnectionStrings["dbEcustomEntities"].ConnectionString, true));
     var vehicle = db.tblVehicles.Where(g => g.VehicleID == vehicleID).FirstOrDefault();
     db.DeleteObject(vehicle);
     return db.SaveChanges();
 }
开发者ID:gsb123,项目名称:ecustoms-project,代码行数:12,代码来源:VehicleFactory.cs



注:本文中的ECustoms.DAL.dbEcustomEntities类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ENTIDADES.bitacorasDTO类代码示例发布时间:2022-05-24
下一篇:
C# Remoting.RemotingRequest类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap