public async Task <IActionResult> BusinessDetails(BusinessDetails bmodel) { var userDetails = await _userManager.FindByEmailAsync(bmodel.Email); var userId = userDetails.Id; if (userId != null) { return(BadRequest(bmodel.Email + "Alread has a Business name")); } else { var businessDetail = new BusinessDetails { UserId = userId, Email = bmodel.Email, BusinessSector = bmodel.BusinessSector, RcNumber = bmodel.RcNumber, BusinessEmail = bmodel.BusinessEmail, Address = bmodel.Address, BusinesssName = bmodel.BusinesssName, EmployeeNumber = bmodel.EmployeeNumber, DirectorsNumber = bmodel.DirectorsNumber }; _dbContext.BusinessDetail.Add(businessDetail); _dbContext.SaveChanges(); return(Ok("Business Details Created")); } }
public void DeleteBusiness(int id) { BusinessDetails businessDetails = new BusinessDetails(); businessDetails = GetSiteById(id); repository.Delete(businessDetails); }
public ActionResult _partialSetEditCPBusinessDetail(BusinessDetails BD) { if (string.IsNullOrEmpty(Convert.ToString(BD.TypeofHosting1))) { BD.TypeofHosting1 = 0; } if (string.IsNullOrEmpty(Convert.ToString(BD.HostingPlatform1))) { BD.HostingPlatform1 = 0; } BD.TypeofHosting = Convert.ToString(BD.TypeofHosting1); BD.HostingPlatform = Convert.ToString(BD.HostingPlatform1); BD.CustId = Convert.ToString(Session["CustId"]); Session["Domain"] = BD.CurrentDomainProvide; bool res = objPartnerBAL.SetCPBusinessDtl(BD); //if (res) //{ // //int Res = Mb.UpdateMemPassword(UserId, Mp.Password); // return Json(new { success = true, responseText = "The attached file is not supported." }, JsonRequestBehavior.AllowGet); //} //else //{ // return Json(new { Success = false, Messege = "Please Enter Valid Old Password", Status = 400 }); //} //Session["Tab"] = "2"; return(RedirectToAction("Chennelpartner", "Partner")); //return View(); }
public ActionResult AddBusiness(BusinessDetails details, FormCollection mydetails, string Cat) { if (Session["Username"] != null) { string fileName = Path.GetFileNameWithoutExtension(details.Imagefile.FileName); string extension = Path.GetExtension(details.Imagefile.FileName); fileName += DateTime.Now.ToString("yymmssfff") + extension; details.Imagepath = "~/Image/" + fileName; fileName = Path.Combine(Server.MapPath("~/Image/"), fileName); details.Imagefile.SaveAs(fileName); Mydbcontext db = new Mydbcontext(); BusinessDetails cat = new BusinessDetails() { Businessname = Convert.ToString(mydetails["Businessname"]), Ownername = Convert.ToString(mydetails["Ownername"]), //Category = Convert.ToString(mydetails["Category"]), Category = Cat, Description = Convert.ToString(mydetails["Description"]), Address = Convert.ToString(mydetails["Address"]), Mobile = Convert.ToString(mydetails["Mobile"]), Imagepath = details.Imagepath, }; db.BusinessDetails.Add(cat); db.SaveChanges(); ViewBag.MyCategory = from t in db.Categories select t.Categoryname; ModelState.Clear(); ViewBag.Msg = "Your Business is Successfully added :)"; return(View()); } else { return(RedirectToAction("Error", "Home")); } }
public ActionResult SetRatings(int id, double rate) { Mydbcontext db = new Mydbcontext(); Ratings r = new Ratings(); r.Rate = rate; r.Businessid = id; r.Username = Session["Username"].ToString(); db.Ratings.Add(r); db.SaveChanges(); int i = 0; double ratings = 0; var bd = from t in db.Ratings where t.Businessid == id select t; foreach (var t in bd) { ratings += t.Rate; i++; } ratings /= i; ratings = Math.Truncate(ratings * 100) / 100; var details = new BusinessDetails() { Id = id, Overall = ratings }; db.BusinessDetails.Attach(details); db.Entry(details).Property(x => x.Overall).IsModified = true; db.Configuration.ValidateOnSaveEnabled = false; db.SaveChanges(); return(RedirectToAction("Details", "Advertise", new { id = id })); }
public BusinessDetails AddNew(BusinessDetails entity) { var result = _context.BusinessDetails.Add(entity); _context.SaveChanges(); return(entity); }
public ActionResult _partialSetCPBusinessDetail(BusinessDetails BD) { BD.CustId = Convert.ToString(Session["CustId"]); bool res = objPartnerBAL.SetCPBusinessDtl(BD); Session["Tab"] = "3"; return(RedirectToAction("ChannelPartner", "CP")); }
public ActionResult _partialSetEditCPBusinessDetail(BusinessDetails BD) { BD.TypeofHosting = Convert.ToString(BD.TypeofHosting1); BD.HostingPlatform = Convert.ToString(BD.HostingPlatform1); BD.CustId = Convert.ToString(Session["CustId"]); bool res = objPartnerBAL.SetCPBusinessDtl(BD); Session["Tab"] = "3"; return(RedirectToAction("Chennelpartner", "Partner")); }
public int SaveSite(BusinessDetails Site, string user) { if (Site.Id > 0) { Site.SetUpdateDetails(user); repository.SaveExisting(Site); return(Site.Id); } Site.SetCreateDetails(user); return(repository.SaveNew(Site).Id); }
public BusinessDetails Get(string id) { var businessInfo = new BusinessDetails() { ID = Guid.NewGuid().ToString(), Image = "Image/6745acb55e9f0150f02720f22bb44png.webp.jpg", Title = "满炖(三好旗舰店)", Order = 11206, ArrivTime = "24", DistributionFee = 4, Address = "沈阳市沈河区西顺城街170-1号新恒基国际大厦1009号", BusinessHours = "10:00-21:00", StartingPrice = 20, Categorys = GetCategory(id), CommodityList = new List <Commodity>() }; var comitiy = new Commodity() { ID = Guid.NewGuid().ToString(), Name = "珍珠奶茶/大杯", Image = "Image/1.png", Price = 10, Details = "醇香奶茶中加入一颗颗香Q弹牙、嚼劲十足的珍珠,人气饮品好喝不簡單。", CategoryId = 0, Orders = "206" }; var comitiy1 = new Commodity() { ID = Guid.NewGuid().ToString(), Name = "珍珠奶茶/大杯", Image = "Image/1.png", Price = 10, Details = "醇香奶茶中加入一颗颗香Q弹牙、嚼劲十足的珍珠,人气饮品好喝不簡單。", CategoryId = 0, Orders = "206" }; var comitiy2 = new Commodity() { ID = Guid.NewGuid().ToString(), Name = "珍珠奶茶/大杯", Image = "Image/1.png", Price = 10, Details = "醇香奶茶中加入一颗颗香Q弹牙、嚼劲十足的珍珠,人气饮品好喝不簡單。", CategoryId = 0, Orders = "206" }; businessInfo.CommodityList.Add(comitiy); businessInfo.CommodityList.Add(comitiy1); businessInfo.CommodityList.Add(comitiy2); return(businessInfo); }
// GET: Advertise public ActionResult Details(int id) { Mydbcontext db = new Mydbcontext(); BusinessDetails bd = db.BusinessDetails.Find(id); if (bd != null) { ViewBag.Rated = from t in db.Ratings where t.Businessid == id select t; return(View(bd)); } return(HttpNotFound()); }
protected void Page_Load(object sender, EventArgs e) { var businessId = Request.QueryString["profile"]; if (businessId != null && int.TryParse(businessId, out int queueBusinessId)) { var searchQueryHandler = new SearchHandler(); BusinessConfig = searchQueryHandler.GetBusinessDetailsByBusinessId(queueBusinessId); } else { Response.Redirect("/Errors/404.aspx"); } }
public static GridRow BindGridData(BusinessDetails source) { var row = new GridRow { IdentityValue = source.Id }; row.AddCell(source.BusinessName); row.AddCell(source.ContactPerson); row.AddCell(source.ContactEmail); row.AddCell(source.ContactPhone); row.AddCell(source.City); row.AddCell(source.Postcode); row.AddActionIcon("fa fa-edit text-success", "Click to view/edit"); row.AddActionIcon("fa fa-trash text-danger", "Click to delete"); row.AddActionIcon("fa fa-cog text-info", "Click to add/update business user"); return(row); }
protected void Page_Load(object sender, EventArgs e) { var businessId = Request.QueryString["businessId"]; if (businessId != null) { var searchQueryHandler = new SearchHandler(); BusinessDetails = searchQueryHandler.GetBusinessDetailsByBusinessId(Convert.ToInt32(businessId)); if (BusinessDetails.BusinessName != null) { businessProfileQuickResponseCodeImage.Src = "data:image/jpg;base64," + BusinessDetails.Profile; } else { throw new HttpException(404, "File Not Found"); } } }
void makeData() { try { string url = App.BaseURL + "AppEnterprise/GetEnterpriseDetail?id=" + _ent.id; Console.WriteLine(url); string result = EasyWebRequest.sendGetHttpWebRequest(url); Console.WriteLine("请求结果:" + result); var list = JsonConvert.DeserializeObject <List <BusinessDetails> >(result); if (list.Count > 0) { details = list[0]; } } catch (Exception ex) { DisplayAlert("Alert", ex.Message, "OK"); } }
public async Task <IActionResult> addbusiness([FromBody] BusinessEntity businessEntity) { try { var business = new BusinessDetails() { BusinessToken = businessEntity.btoken, Business_Name = businessEntity.bname, Business_Type = businessEntity.btype, Address = businessEntity.baddress, Contact_Number = businessEntity.bcontactNumber, City = businessEntity.bcity, State = businessEntity.bstate }; db.BusinessDetails.Add(business); db.SaveChanges(); return(Ok(business)); } catch { return(BadRequest()); } }
public BusinessDetails GetBusinessDetailsByBusinessId(int businessId) { var queryResults = from c in dbContext.vwGetBusinessDetails where c.Id == businessId select c; if (queryResults.Any() && queryResults.Count() == 1) { var result = queryResults.FirstOrDefault(); var businessDetails = new BusinessDetails() { BusinessId = result.Id, DateCreated = result.DateCreated, BusinessName = result.Name, Address = result.Address, Capacity = result.Capacity, Profile = Convert.ToBase64String(result.ProfileImage) }; return(businessDetails); } return(new BusinessDetails()); }
public ActionResult BusinessDetails(BusinessDetailsView bdv, HttpPostedFileBase file, HttpPostedFileBase file1, HttpPostedFileBase file2) { try { if (file == null) { ViewBag.filemsg = "Please upload GSTIN Document"; return(View()); } else { var a = Path.GetExtension(file.FileName); if (a == ".pdf" || a == ".docx") { if (file1 == null) { ViewBag.filemsg = "Please upload TAN Document"; return(View()); } else { var b = Path.GetExtension(file1.FileName); if (b == ".pdf" || b == ".docx") { if (file2 == null) { ViewBag.filemsg = "Please upload CIN Document"; return(View()); } else { var c = Path.GetExtension(file2.FileName); if (c == ".pdf" || c == ".docx") { BusinessDetails bd = new BusinessDetails(); if (Session["Admin"] != null) { bd.VendorId = Convert.ToInt32(Session["Admin"]); bd.BusinessName = bdv.BusinessName; bd.CIN = bdv.CIN; string cin = Path.GetFileName(file2.FileName); string path2 = Path.Combine(Server.MapPath("~/CINDocument"), cin); file2.SaveAs(path2); bd.CINDocument = cin; bd.TANNumber = bdv.TANNumber; string tan = Path.GetFileName(file1.FileName); string path1 = Path.Combine(Server.MapPath("~/TANDocument"), tan); file1.SaveAs(path1); bd.TANDocument = tan; bd.GSTINProvisionalID = bdv.GSTINProvisionalID; string gst = Path.GetFileName(file.FileName); string path = Path.Combine(Server.MapPath("~/GSTINDocument"), gst); file.SaveAs(path); bd.GSTINDucument = gst; bd.RegisteredBusineesAddress = bdv.RegisteredBusineesAddress; dbd.businessdetails.Add(bd); dbd.SaveChanges(); return(RedirectToAction("BankDetails")); } } else { ViewBag.filemsg = "Please enter CIN of correct type."; return(View()); } return(View()); } } else { ViewBag.filemsg = "Please enter TAN of correct type."; return(View()); } } } else { ViewBag.filemsg = "Please enter GSTIN of correct type."; return(View()); } } } catch (Exception e) { throw e; } }
public int MapViewModelToSite(BusinessViewModel model, string user, bool performSave) { BusinessDetails businessDetails = new BusinessDetails(); businessDetails = GetSiteById(model.Id); //businessDetails = businessDetails == null ? Mapper.Map<BusinessViewModel, BusinessDetails>(model) : // Mapper.Map(model, businessDetails); // businessDetails = businessDetails == null ? new BusinessViewModel() : Mapper.Map<BusinessDetails, BusinessDetails>(model); if (businessDetails == null) { businessDetails = new BusinessDetails(); businessDetails.Id = model.Id; businessDetails.BusinessName = model.BusinessName; //businessDetails.LastSubscribedDate = model.LastSubscribedDate; //businessDetails.LastExpirationDate = model.LastExpirationDate; businessDetails.AddressLine1 = model.AddressLine1; businessDetails.AddressLine2 = model.AddressLine2; businessDetails.AddressLine3 = model.AddressLine3; businessDetails.City = model.City; businessDetails.Postcode = model.Postcode; businessDetails.ContactPerson = model.ContactPerson; businessDetails.ContactEmail = model.ContactEmail; businessDetails.ContactPhone = model.ContactPhone; businessDetails.IdentityUserId = "0"; businessDetails.NotifyWeekly = model.NotifyWeekly == true; businessDetails.DmdAmp = model.DmdAmp; businessDetails.DmdAmpp = model.DmdAmpp; businessDetails.DmdVmp = model.DmdVmp; businessDetails.DmdVmpp = model.DmdVmpp; businessDetails.DmdVtm = model.DmdVtm; businessDetails.DmdForm = model.DmdForm; businessDetails.DmdGtin = model.DmdGtin; businessDetails.DmdRoute = model.DmdRoute; businessDetails.DmdSupplier = model.DmdSupplier; } else { businessDetails.Id = model.Id; businessDetails.BusinessName = model.BusinessName; businessDetails.LastSubscribedDate = model.LastSubscribedDate; businessDetails.LastExpirationDate = model.LastExpirationDate; businessDetails.AddressLine1 = model.AddressLine1; businessDetails.AddressLine2 = model.AddressLine2; businessDetails.AddressLine3 = model.AddressLine3; businessDetails.City = model.City; businessDetails.Postcode = model.Postcode; businessDetails.ContactPerson = model.ContactPerson; businessDetails.ContactEmail = model.ContactEmail; businessDetails.ContactPhone = model.ContactPhone; businessDetails.NotifyWeekly = model.NotifyWeekly == true; businessDetails.IdentityUserId = model.IdentityUserId; businessDetails.DmdAmp = model.DmdAmp; businessDetails.DmdAmpp = model.DmdAmpp; businessDetails.DmdVmp = model.DmdVmp; businessDetails.DmdVmpp = model.DmdVmpp; businessDetails.DmdVtm = model.DmdVtm; businessDetails.DmdForm = model.DmdForm; businessDetails.DmdGtin = model.DmdGtin; businessDetails.DmdRoute = model.DmdRoute; businessDetails.DmdSupplier = model.DmdSupplier; } if (!performSave) { return(businessDetails.Id); } if (businessDetails.Id > 0) { businessDetails.SetUpdateDetails(user); repository.SaveExisting(businessDetails); } else { businessDetails.SetCreateDetails(user); repository.AddNew(businessDetails); } return(businessDetails.Id); }
public bool SetCPBusinessDtl(BusinessDetails bD) { return(objInfPub.setCPBusinessDtl(bD)); }
public ActionResult Details(BusinessDetails detail) { return(View()); }