public ActionResult Details(int id) { UserPermissionAction("client", RoleAction.detail.ToString()); CheckPermission(); if (id < 0) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Customer customer = _CustomerService.GetCustomers().Where(c => c.UserId == id).FirstOrDefault(); Mapper.CreateMap <Onlo.Entity.Customer, Onlo.Models.CustomerModel>(); Onlo.Models.CustomerModel CustomerModel = Mapper.Map <Onlo.Entity.Customer, Onlo.Models.CustomerModel>(customer); var Company = _CompanyService.GetCompany(customer.CompanyID); if (Company != null) { CustomerModel.CompanyName = Company.CompanyName; CustomerModel.CompanyAddress = Company.CompanyAddress; CustomerModel.LogoPath = Company.LogoPath; CustomerModel.VisionMission = Company.VisionMission; CustomerModel.AboutCompany = Company.AboutCompany; CustomerModel.OtherInformation = Company.OtherInformation; } return(View(CustomerModel)); }
public ActionResult Edit(int id) { UserPermissionAction("vendor", RoleAction.edit.ToString()); CheckPermission(); if (id < 0) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } // Customer objVendor = _CustomerService.GetCustomers().Where(x => x.CompanyID == Convert.ToInt32(id)).FirstOrDefault(); Customer objVendor = _CustomerService.GetCustomer(id); var models = new List <CustomerModel>(); Mapper.CreateMap <Onlo.Entity.Customer, Onlo.Models.CustomerModel>(); Onlo.Models.CustomerModel customermodel = Mapper.Map <Onlo.Entity.Customer, Onlo.Models.CustomerModel>(objVendor); if (objVendor == null) { return(HttpNotFound()); } //var companyEquiment = _CompanyEquipmentService.GetCompanyEquipments(); //var item = _IItemService.GetItems(); //var Equiment = _IItemService.GetItems(); //var selected = _CompanyEquipmentService.GetCompanyEquipments().Where(x => x.CompanyID == objVendor.CompanyID).Select(x => x.ItemId); var company = _CompanyService.GetCompany(objVendor.CompanyID); if (company != null) { customermodel.CompanyName = company.CompanyName; customermodel.AboutCompany = company.AboutCompany; customermodel.VisionMission = company.VisionMission; customermodel.LogoPath = company.LogoPath; customermodel.OtherInformation = company.OtherInformation; customermodel.BusinessBrochureUrl = company.BusinessBrochureUrl; //customermodel.EquimentList = _IItemService.GetItems().AsEnumerable().Select(c => new SelectListItem { Value = c.ItemId.ToString(), Text = c.ItemName, Selected = selected.Contains(c.ItemId) }).ToList(); } var CompanyLocation = _CompanyLocationService.GetCompanyLocations(); List <CompanyLocation> objcountrylist = (from data in CompanyLocation where data.CompanyID == objVendor.CompanyID select data).ToList(); SelectList objmodeldata = new SelectList(objcountrylist, "Id", "CountryName", 0); /*Assign value to model*/ CustomerModel objcountrymodel = new CustomerModel(); customermodel.CompanyLocationList = _CompanyLocationService.GetCompanyLocations().Where(x => x.CompanyID == objVendor.CompanyID).Select(x => x.Location).ToList(); return(View(customermodel)); }
public ActionResult SendEmailToVendorForsubscription(int id) { if (id < 0) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var Customer = _CustomerService.GetCustomers().Where(x => x.CustomerId == id).FirstOrDefault(); Mapper.CreateMap <Onlo.Entity.Customer, Onlo.Models.CustomerModel>(); Onlo.Models.CustomerModel CustomerModel = Mapper.Map <Onlo.Entity.Customer, Onlo.Models.CustomerModel>(Customer); string FirstName = Customer.FirstName; string EmailId = Customer.EmailId; string SubscriptionStartDate = Convert.ToString(Customer.SubscriptionStartDate); string SubscriptionEndDate = Convert.ToString(Customer.SubscriptionEndDate); string AccountRenewalDate = Convert.ToString(Customer.SubscriptionEndDate.Value.AddDays(1)); var Payment = _MonthlySubscriptionService.GetMonthlySubscriptions().Where(x => x.SubscriptionMonth == DateTime.Now.ToString("MMMM")).FirstOrDefault(); string Amount = Payment.SubscriptionPrice; JobScheduler.SubscriptionJob(FirstName, EmailId, SubscriptionStartDate, SubscriptionEndDate, AccountRenewalDate, Amount); TempData["ShowMessage"] = "success"; TempData["MessageBody"] = "subscription mail send successfully."; return(RedirectToAction("SendEmailBysubscription")); }