コード例 #1
0
        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");
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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));
        }
コード例 #4
0
 public string UpdateVendorImage(VendorImage vendorImage, long id, long vid)
 {
     return(vendorImageRepository.UpdateVendorImage(vendorImage, id, vid));
 }
コード例 #5
0
 public string UpdateVendorVenue(VendorImage vendorImage)
 {
     return(vendorImageRepository.UpdateVendorVenue(vendorImage));
 }
コード例 #6
0
 public string DeleteImage(VendorImage vendorImage)
 {
     return(vendorImageRepository.DeleteImage(vendorImage));
 }
コード例 #7
0
 public string UpdateVendorVenue(VendorImage vendorImage)
 {
     _dbContext.Entry(vendorImage).CurrentValues.SetValues(vendorImage);
     _dbContext.SaveChanges();
     return("updated");
 }
コード例 #8
0
 public string DeleteImage(VendorImage vendorImage)
 {
     _dbContext.VendorImage.Remove(vendorImage);
     _dbContext.SaveChanges();
     return("success");
 }
コード例 #9
0
 public VendorImage AddVendorImage(VendorImage vendorImage)
 {
     _dbContext.VendorImage.Add(vendorImage);
     _dbContext.SaveChanges();
     return(vendorImage);
 }
コード例 #10
0
 public List <VendorImage> VendorImageList(VendorImage vendorImage)
 {
     return(_dbContext.VendorImage.ToList());
 }