Beispiel #1
0
        public int Update(int RouteId, int PortalId, int ContentItemId, string CultureCode, string RouteName, string RouteUrl, string PhysicalFile,
                          bool CheckPhysicalUrlAccess, string RouteValueDictionary, string Description, bool Discontinued)
        {
            int i = 0;

            using (CommonEntities dbContext = new CommonEntities())
            {
                using (System.Transactions.TransactionScope transcope = new System.Transactions.TransactionScope())
                {
                    dbContext.Connection.Open();
                    aspnet_Routes entity = dbContext.aspnet_Routes.Single(x => x.RouteId == RouteId);
                    entity.PortalId               = PortalId;
                    entity.ContentItemId          = ContentItemId;
                    entity.CultureCode            = CultureCode;
                    entity.RouteName              = RouteName;
                    entity.RouteUrl               = RouteUrl;
                    entity.PhysicalFile           = PhysicalFile;
                    entity.CheckPhysicalUrlAccess = CheckPhysicalUrlAccess;
                    entity.RouteValueDictionary   = RouteValueDictionary;
                    entity.Description            = Description;
                    entity.Discontinued           = Discontinued;
                    i = dbContext.SaveChanges();
                    dbContext.Connection.Close();
                    transcope.Complete();
                }
            }
            return(i);
        }
Beispiel #2
0
        ////INSERT- UPDATE - DELETE
        public int Insert(int PortalId, int ContentItemId, string CultureCode, string RouteName, string RouteUrl, string PhysicalFile,
                          bool CheckPhysicalUrlAccess, string RouteValueDictionary, string Description, bool Discontinued)
        {
            int returnValue = 0;

            using (CommonEntities dbContext = new CommonEntities())
            {
                using (System.Transactions.TransactionScope transcope = new System.Transactions.TransactionScope())
                {
                    int           ListOrder = (from u in dbContext.aspnet_Routes select u.ListOrder).DefaultIfEmpty(0).Max() + 1;
                    aspnet_Routes entity    = new aspnet_Routes();
                    entity.PortalId               = PortalId;
                    entity.ContentItemId          = ContentItemId;
                    entity.CultureCode            = CultureCode;
                    entity.RouteName              = RouteName;
                    entity.RouteUrl               = RouteUrl;
                    entity.PhysicalFile           = PhysicalFile;
                    entity.CheckPhysicalUrlAccess = CheckPhysicalUrlAccess;
                    entity.RouteValueDictionary   = RouteValueDictionary;
                    entity.Description            = Description;
                    entity.ListOrder              = ListOrder;
                    entity.Discontinued           = Discontinued;
                    dbContext.AddToaspnet_Routes(entity);
                    returnValue = dbContext.SaveChanges();
                    dbContext.Connection.Close();
                    transcope.Complete();
                }
            }
            return(returnValue);
        }
Beispiel #3
0
 public aspnet_Routes GetDetails(int RouteId)
 {
     using (CommonEntities dbContext = new CommonEntities())
     {
         dbContext.CommandTimeout = Settings.CommandTimeout;
         aspnet_Routes entity = dbContext.aspnet_Routes.Where(x => x.RouteId == RouteId).FirstOrDefault();
         return(entity);
     }
 }
Beispiel #4
0
 public int UpdateSortKey(int RouteId, int ListOrder)
 {
     using (CommonEntities dbContext = new CommonEntities())
     {
         dbContext.CommandTimeout = Settings.CommandTimeout;
         aspnet_Routes album_obj = dbContext.aspnet_Routes.Single(x => x.RouteId == RouteId);
         album_obj.ListOrder = ListOrder;
         int i = dbContext.SaveChanges();
         return(i);
     }
 }
Beispiel #5
0
 public int UpdateStatus(int RouteId, bool Discontinued)
 {
     using (CommonEntities dbContext = new CommonEntities())
     {
         dbContext.CommandTimeout = Settings.CommandTimeout;
         aspnet_Routes entity = dbContext.aspnet_Routes.Single(x => x.RouteId == RouteId);
         entity.Discontinued = Discontinued;
         int i = dbContext.SaveChanges();
         return(i);
     }
 }
Beispiel #6
0
 public static void Delete(int RouteId)
 {
     using (CommonEntities dbContext = new CommonEntities())
     {
         using (System.Transactions.TransactionScope transcope = new System.Transactions.TransactionScope())
         {
             dbContext.Connection.Open();
             aspnet_Routes entity = dbContext.aspnet_Routes.Single(x => x.RouteId == RouteId);
             dbContext.aspnet_Routes.DeleteObject(entity);
             dbContext.SaveChanges();
             dbContext.Connection.Close();
             transcope.Complete();
         }
     }
 }