public static void ExcludeGroupModal(int idGroupModal) { using (var context = new Entity.OiWeb()) { var dataGroupModalPages = context.GroupModalPages.Where(p => p.idGroupModal == idGroupModal).ToList(); if (dataGroupModalPages != null) { context.GroupModalPages.RemoveRange(dataGroupModalPages); context.SaveChanges(); } var dataGroupModalCities = context.GroupModalCities.Where(p => p.idGroupModal == idGroupModal).ToList(); if (dataGroupModalCities != null) { context.GroupModalCities.RemoveRange(dataGroupModalCities); context.SaveChanges(); } var data = context.GroupModals.Find(idGroupModal); if (data != null) { context.GroupModals.Remove(data); context.SaveChanges(); } } }
public static void Delete(int idPlan, int idPriceGroup) { using (var context = new Entity.OiWeb()) { var deletePrices = from prices in context.Prices where prices.idPlan == idPlan && prices.idPriceGroup == idPriceGroup select prices; foreach (var price in deletePrices) { context.Prices.Remove(price); } context.SaveChanges(); var deletePlanGroup = from planGroup in context.PlanGroups where planGroup.idPlan == idPlan && planGroup.idPriceGroup == idPriceGroup select planGroup; foreach (var planGroups in deletePlanGroup) { context.PlanGroups.Remove(planGroups); } context.SaveChanges(); } }
public static void Delete(int idPage) { using (var context = new Entity.OiWeb()) { var dataGroupCustomDataPages = context.GroupCustomDataPages.Where(p => p.idPage == idPage).ToList(); if (dataGroupCustomDataPages != null) { context.GroupCustomDataPages.RemoveRange(dataGroupCustomDataPages); context.SaveChanges(); } var dataGroupModalPages = context.GroupModalPages.Where(p => p.idPage == idPage).ToList(); if (dataGroupModalPages != null) { context.GroupModalPages.RemoveRange(dataGroupModalPages); context.SaveChanges(); } var dataPage = context.Pages.Find(idPage); if (dataPage != null) { context.Pages.Remove(dataPage); context.SaveChanges(); } } }
public static void UpdateUser(Entity.CMS_Account account) { if (account.password != null) { var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(account.password); account.password = System.Convert.ToBase64String(plainTextBytes); } using (var context = new Entity.OiWeb()) { var query = (from c in context.CMS_Account where c.idAccount == account.idAccount select c).First(); query.name = account.name; if (account.password == "" || account.password == null) { account.password = query.password; } query.password = account.password; query.email = account.email; query.isActive = account.isActive; context.SaveChanges(); } }
public static void Insert(List <PriceGroupCity> datas) { using (var context = new Entity.OiWeb()) { context.PriceGroupCities.AddRange(datas); context.SaveChanges(); } }
public static void Insert(Entity.GroupCustomDataPage data) { using (var context = new Entity.OiWeb()) { context.GroupCustomDataPages.Add(data); context.SaveChanges(); } }
public static void Insert(List <Entity.GroupCustomDataPage> datas) { using (var context = new Entity.OiWeb()) { context.GroupCustomDataPages.AddRange(datas); context.SaveChanges(); } }
public static void Create(Entity.PlanProduct planProduct) { using (var context = new Entity.OiWeb()) { context.PlanProducts.Add(planProduct); context.SaveChanges(); } }
public static void Insert(Entity.PlanRegulation data) { using (var context = new Entity.OiWeb()) { context.PlanRegulations.Add(data); context.SaveChanges(); } }
public static void Create(Entity.CMS_AccountLoginLog accountLoginLog) { using (var context = new Entity.OiWeb()) { context.CMS_AccountLoginLog.Add(accountLoginLog); context.SaveChanges(); } }
public static void Insert(PriceGroupCity data) { using (var context = new Entity.OiWeb()) { context.PriceGroupCities.Add(data); context.SaveChanges(); } }
public static void CreatePlanGroup(Entity.PlanGroup planGroup) { using (var context = new Entity.OiWeb()) { context.PlanGroups.Add(planGroup); context.SaveChanges(); } }
public static void Save(Entity.PriceGroup group) { using (var context = new Entity.OiWeb()) { context.PriceGroups.Add(group); context.SaveChanges(); } }
public static void Create(Entity.Page page) { using (var context = new Entity.OiWeb()) { context.Pages.Add(page); context.SaveChanges(); } }
public static void RemoveByIdPriceGroup(int id) { using (var context = new Entity.OiWeb()) { var datas = context.PriceGroupCities.Where(w => w.idPriceGroup == id).ToList(); context.PriceGroupCities.RemoveRange(datas); context.SaveChanges(); } }
public static void RemoveByIdGroupAndPage(int idGroup, int idPage) { using (var context = new Entity.OiWeb()) { var datas = context.GroupCustomDataPages.Where(w => w.idGroup == idGroup && w.idPage == idPage).ToList(); context.GroupCustomDataPages.RemoveRange(datas); context.SaveChanges(); } }
public static void ExcludeCustomData(int idGroup) { using (var context = new Entity.OiWeb()) { var dataGroupCustomDataPages = context.GroupCustomDataPages.Where(p => p.idGroup == idGroup).ToList(); if (dataGroupCustomDataPages != null) { context.GroupCustomDataPages.RemoveRange(dataGroupCustomDataPages); context.SaveChanges(); } var dataGroupCustomData = context.GroupCustomDatas.Find(idGroup); if (dataGroupCustomData != null) { context.GroupCustomDatas.Remove(dataGroupCustomData); context.SaveChanges(); } } }
public static void Create(Entity.GroupCustomData groupCustomData) { using (var context = new Entity.OiWeb()) { groupCustomData.isActive = true; groupCustomData.dtCreate = DateTime.Now; context.GroupCustomDatas.Add(groupCustomData); context.SaveChanges(); } }
public static void InsertGroupModal(Entity.GroupModal entity) { entity.dtCreate = DateTime.Now; using (var context = new Entity.OiWeb()) { context.GroupModals.Add(entity); context.SaveChanges(); } }
public static void SaveUser(Entity.CMS_Account account) { using (var context = new Entity.OiWeb()) { account.dtCreate = DateTime.Now; var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(account.password); account.password = System.Convert.ToBase64String(plainTextBytes); context.CMS_Account.Add(account); context.SaveChanges(); } }
public static void DesvinculaGroupPage(int idGroup, int idPage) { using (var context = new Entity.OiWeb()) { var dataGroupCustomDataPages = context.GroupCustomDataPages.Where(p => p.idGroup == idGroup && p.idPage == idPage).ToList(); if (dataGroupCustomDataPages != null) { context.GroupCustomDataPages.RemoveRange(dataGroupCustomDataPages); context.SaveChanges(); } } }
public static void Remove(int idPlanRegulation) { using (var context = new Entity.OiWeb()) { var data = context.PlanRegulations.Find(idPlanRegulation); if (data != null) { context.PlanRegulations.Remove(data); context.SaveChanges(); } } }
public static void DesvincularGroup(int idModal, int idGroupModal) { using (var context = new Entity.OiWeb()) { var dataGroupModalPages = context.GroupModalPages.Where(p => p.idModal == idModal && p.idGroupModal == idGroupModal).ToList(); if (dataGroupModalPages != null) { context.GroupModalPages.RemoveRange(dataGroupModalPages); context.SaveChanges(); } } }
public static void Update(Entity.GroupCustomData groupCustomData) { using (var context = new Entity.OiWeb()) { var query = (from c in context.GroupCustomDatas where c.idGroup == groupCustomData.idGroup select c).First(); query.name = groupCustomData.name; query.description = groupCustomData.description; context.SaveChanges(); } }
public static void Update(Entity.Page page) { using (var context = new Entity.OiWeb()) { var query = (from c in context.Pages where c.idPage == page.idPage select c).First(); query.name = page.name; query.description = page.description; query.isCommon = page.isCommon; query.isActive = page.isActive; context.SaveChanges(); } }
public static void Update(Entity.PlanProduct planProduct) { using (var context = new Entity.OiWeb()) { var query = (from c in context.PlanProducts where c.idPlan == planProduct.idPlan select c).First(); query.isVisible = planProduct.isVisible; query.linkEcommerce = planProduct.linkEcommerce; query.name = planProduct.name; query.defaultSKU = planProduct.defaultSKU; query.description = planProduct.description; context.SaveChanges(); } }
public static void Update(Entity.PlanRegulation data) { using (var context = new Entity.OiWeb()) { var planregulation = context.PlanRegulations.Find(data.idPlanRegulation); if (planregulation != null) { context.PlanRegulations.Attach(planregulation); var entry = context.Entry(planregulation); entry.Property(e => e.name).IsModified = true; entry.Property(e => e.link).IsModified = true; entry.Property(e => e.type).IsModified = true; context.SaveChanges(); } } }
public static void UpdateModal(Entity.Modal data) { using (var context = new Entity.OiWeb()) { var modal = context.Modals.Find(data.idModal); if (modal != null) { modal.name = data.name; modal.description = data.description; context.Modals.Attach(modal); var entry = context.Entry(modal); entry.Property(e => e.name).IsModified = true; entry.Property(e => e.description).IsModified = true; context.SaveChanges(); } } }
public static void Update(Entity.Price price) { using (var context = new Entity.OiWeb()) { var query = (from c in context.Prices where c.idPlan == price.idPlan && c.idPriceGroup == price.idPriceGroup && c.idPriceLoyalty == price.idPriceLoyalty select c).FirstOrDefault(); if (query == null) { context.Prices.Add(price); } else { query.value = price.value; query.valueCombo = price.valueCombo; } context.SaveChanges(); } }