public string UpdateVendorImage(VendorImage vendorImage, long id, long vid) { var Getimage = _dbContext.VendorImage.SingleOrDefault(m => m.ImageId == vendorImage.ImageId); _dbContext.Entry(Getimage).CurrentValues.SetValues(vendorImage); _dbContext.SaveChanges(); return("updated"); }
public VendorImage AddVendorImage(VendorImage vendorImage, Vendormaster vendorMaster) { DateTime updateddate = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, INDIAN_ZONE); vendorImage.Status = "Active"; vendorImage.UpdatedDate = updateddate; vendorImage.VendorMasterId = vendorMaster.Id; vendorImage = vendorImageRepository.AddVendorImage(vendorImage); return(vendorImage); }
public ActionResult Create(BranchVendor branchVendor, HttpPostedFileBase File) { if (ModelState.IsValid) { VendorCompany vendorCompany = new VendorCompany() { VendorId = (int)System.Web.HttpContext.Current.Session["vendorid"], BranchName = branchVendor.BranchName, ShortDescription = branchVendor.ShortDescription, LongDescription = branchVendor.LongDescription, Email = branchVendor.Email, Mobile = branchVendor.Mobile, Country = branchVendor.Country, State = branchVendor.StateId, City = branchVendor.CityId, Street = branchVendor.Street, ZIPCode = branchVendor.ZIPCode, AddressLine1 = branchVendor.AddressLine1, AddressLine2 = branchVendor.AddressLine2, }; db.VendorCompanies.Add(vendorCompany); VendorImage vendorImage = new VendorImage(); if (File == null) { ViewBag.mess = "please select image."; } else { string filex = Path.GetExtension(File.FileName); if (filex.Equals(".jpg") || filex.Equals(".png")) { string imageName = System.IO.Path.GetFileName(File.FileName); string Filepath = Server.MapPath("~/ImageFolder/" + imageName); File.SaveAs(Filepath); vendorImage.VendorCompanyId = branchVendor.VendorCompanyId; vendorImage.ImageName = imageName; db.VendorImages.Add(vendorImage); } } ViewBag.StateList = db.States; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(branchVendor)); }
public string UpdateVendorImage(VendorImage vendorImage, long id, long vid) { return(vendorImageRepository.UpdateVendorImage(vendorImage, id, vid)); }
public string UpdateVendorVenue(VendorImage vendorImage) { return(vendorImageRepository.UpdateVendorVenue(vendorImage)); }
public string DeleteImage(VendorImage vendorImage) { return(vendorImageRepository.DeleteImage(vendorImage)); }
public string UpdateVendorVenue(VendorImage vendorImage) { _dbContext.Entry(vendorImage).CurrentValues.SetValues(vendorImage); _dbContext.SaveChanges(); return("updated"); }
public string DeleteImage(VendorImage vendorImage) { _dbContext.VendorImage.Remove(vendorImage); _dbContext.SaveChanges(); return("success"); }
public VendorImage AddVendorImage(VendorImage vendorImage) { _dbContext.VendorImage.Add(vendorImage); _dbContext.SaveChanges(); return(vendorImage); }
public List <VendorImage> VendorImageList(VendorImage vendorImage) { return(_dbContext.VendorImage.ToList()); }