public bool UpdateBrandOutletMasterDetailsInfo(List <NewBrandOutletModel> reBrandItems) { try { using (var entity = new BrandOutletMonitoringEntities()) { foreach (var items in reBrandItems) { var shopInfoes = entity.BrandOutletDetails.FirstOrDefault(x => x.BrandOutletToken == items.Token && x.BrandCategoryId == items.BrandCategoryId && x.BrandSubCategoryId == items.BrandSubCategoryId); if (shopInfoes != null) { if (items.Quantity != 0) { shopInfoes.Quantity = items.Quantity; } shopInfoes.UpdatedBy = 1; shopInfoes.UpdatedDate = DateTime.Now; entity.Entry(shopInfoes).State = EntityState.Modified; } entity.SaveChanges(); } } } catch (Exception) { return(false); } return(true); }
public bool UpadteBrandingTeamInfo(tblBrandingTeam brandingInfo) { tblBrandingTeam brandingInfoes = _entities.tblBrandingTeams.FirstOrDefault(x => x.Id == brandingInfo.Id); if (brandingInfo != null) { if (brandingInfo.Name != null) { if (brandingInfoes != null) { brandingInfoes.Name = brandingInfo.Name; } } if (brandingInfo.EmployeeId != null) { if (brandingInfoes != null) { brandingInfoes.EmployeeId = brandingInfo.EmployeeId; } } if (brandingInfo.MobileNumber != null) { if (brandingInfoes != null) { brandingInfoes.MobileNumber = brandingInfo.MobileNumber; } } if (brandingInfo.Email != null) { if (brandingInfoes != null) { brandingInfoes.Email = brandingInfo.Email; } } if (brandingInfo.Active != null) { if (brandingInfoes != null) { brandingInfoes.Active = brandingInfo.Active; } } if (brandingInfo.UpdatedDate != null) { if (brandingInfoes != null) { brandingInfoes.UpdatedDate = brandingInfo.UpdatedDate; } } if (brandingInfo.DeletedDate != null) { if (brandingInfoes != null) { brandingInfoes.DeletedDate = brandingInfo.DeletedDate; } } _entities.Entry(brandingInfoes).State = EntityState.Modified; _entities.SaveChanges(); } else { return(false); } return(true); }
public bool UpadteBrandShopInfo(BrandShop shopInfo) { BrandShop shopInfoes = _entities.BrandShops.FirstOrDefault(x => x.Id == shopInfo.Id); if (shopInfo != null) { if (shopInfo.ShopName != null) { if (shopInfoes != null) { shopInfoes.ShopName = shopInfo.ShopName; } } if (shopInfo.ShopCategory != null) { if (shopInfoes != null) { shopInfoes.ShopCategory = shopInfo.ShopCategory; } } if (shopInfo.Address != null) { if (shopInfoes != null) { shopInfoes.Address = shopInfo.Address; } } if (shopInfo.Code != null) { if (shopInfoes != null) { shopInfoes.Code = shopInfo.Code; } } if (shopInfo.OwnerName != null) { if (shopInfoes != null) { shopInfoes.OwnerName = shopInfo.OwnerName; } } if (shopInfo.Phone != null) { if (shopInfoes != null) { shopInfoes.Phone = shopInfo.Phone; } } if (shopInfo.Active != null) { if (shopInfoes != null) { shopInfoes.Active = shopInfo.Active; } } if (shopInfo.EditedDate != null) { if (shopInfoes != null) { shopInfoes.EditedDate = shopInfo.EditedDate; } } if (shopInfo.DeletedDate != null) { if (shopInfoes != null) { shopInfoes.DeletedDate = shopInfo.DeletedDate; } } _entities.Entry(shopInfoes).State = EntityState.Modified; _entities.SaveChanges(); } else { return(false); } return(true); }
public bool UpadteBrandingIssueSolvedInfo(BrandIssueMaster branding) { try { var brandings = _entities.BrandIssueMasters.FirstOrDefault(x => x.IssueId == branding.IssueId); if (brandings != null) { if (branding.AddedBy != null) { brandings.AddedBy = branding.AddedBy; } if (branding.AddedDate != null) { brandings.AddedDate = branding.AddedDate; } if (branding.SolvedBy != null) { brandings.SolvedBy = branding.SolvedBy; } if (branding.SolvedDate != null) { brandings.SolvedDate = branding.SolvedDate; } if (branding.TrashBy != null) { brandings.TrashBy = branding.TrashBy; } if (branding.TrashBy != null) { brandings.TrashDate = branding.TrashDate; } if (branding.ReActiveBy != null) { brandings.ReActiveBy = branding.ReActiveBy; } if (branding.ReActiveDate != null) { brandings.ReActiveDate = branding.ReActiveDate; } if (branding.Active != null) { brandings.Active = branding.Active; } if (branding.Trash != null) { brandings.Trash = branding.Trash; } if (branding.Seen != null) { brandings.Seen = branding.Seen; } if (branding.Solved != null) { brandings.Solved = branding.Solved; } _entities.Entry(brandings).State = EntityState.Modified; _entities.SaveChanges(); } else { return(false); } } catch (Exception exception) { throw exception; } //finally //{ // EntityDispose(true); //} return(true); }