public ActionResult vendorreply(string orderid) { DateTime indianTime = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, INDIAN_ZONE); var s1 = ViewBag.orderdetails = orderService.allorderslist1().ToList().Where(m => m.orderid == long.Parse(orderid)).FirstOrDefault(); var userdata = userLoginDetailsService.GetUserId((int)s1.cutomerid); var userdetails = userLoginDetailsService.GetUser((int)s1.cutomerid); QuotationsList quotationsList = new QuotationsList(); var s12 = ViewBag.orderdetails = orderService.allorderslist1().ToList().Where(m => m.orderid == long.Parse(orderid)).ToList(); var vendordetails = newmanageuse.getvendor(Convert.ToInt32(s1.vid)); List <SPGETNpkg_Result> package = new List <SPGETNpkg_Result>(); List <SPGETNpkg_Result> package1 = new List <SPGETNpkg_Result>(); List <SPGETNpkg_Result> package2 = new List <SPGETNpkg_Result>(); package = viewservicesss.getvendorpkgs(Convert.ToString(s1.vid)); txtto = vendordetails.EmailId; string vname = vendordetails.BusinessName; ViewBag.name = vendordetails.BusinessName; ViewBag.Email = vendordetails.EmailId; ViewBag.bookdate = s1.bookdate.ToString(); ViewBag.orderid = orderid; return(View()); }
public ActionResult Index() { if (System.Web.HttpContext.Current.User.Identity.IsAuthenticated) { var user = (CustomPrincipal)System.Web.HttpContext.Current.User; var userResponse = userLoginDetailsService.GetUser((int)user.UserId); if (user.UserType == "Admin") { return(RedirectToAction("dashboard", "dashboard", new { id = userResponse.UserLoginId })); } } return(View()); }
public ActionResult SearchVendor(string searchvendor, string command, Vendormaster vendormaster, string pemail, string id) { UserLogin userlogin = new UserLogin(); UserDetail userdetails = new UserDetail(); //var details = vendorMasterService.SearchVendors(); //var particularvendor = details.Where(m => m.BusinessName.Contains(searchvendor)).FirstOrDefault(); //var VendorList = vendorMasterService.SearchVendors().Where(m => m.BusinessName.ToLower() == searchvendor.TrimEnd()).FirstOrDefault(); var VendorList = vendorMasterService.SearchVendors().Where(m => m.BusinessName.ToLower().Contains(searchvendor.ToLower().TrimEnd())).FirstOrDefault(); ViewBag.VendorList = VendorList; if (command == "Update") { if (pemail != vendormaster.EmailId) { int query = vendorMasterService.checkemail(vendormaster.EmailId); if (query != 0) { return(Content("<script language='javascript' type='text/javascript'>alert('Email ID Already Taken');location.href='/admin/Vendors/SearchVendor'</script>")); } } var updatedetails = vendormaster; VenorVenueSignUpService venorVenueSignUpService = new VenorVenueSignUpService(); vendormaster = vendorMasterService.GetVendor(long.Parse(id)); vendormaster.EmailId = updatedetails.EmailId; vendormaster.ContactNumber = updatedetails.ContactNumber; vendormaster.ContactPerson = updatedetails.ContactPerson; vendormaster = vendorMasterService.UpdateVendorDetails(vendormaster, long.Parse(id)); // Updating Email ID in Vendor Master Table //userlogin.UserName = pemail; //userlogin = venorVenueSignUpService.GetUserLogdetails(userlogin); userlogin = venorVenueSignUpService.GetParticularUserdetails(pemail); userlogin.UserName = vendormaster.EmailId; userlogin = userLoginDetailsService.UpdateUserName(userlogin, pemail); // Updating Email ID in User Login Table //userdetails = userLoginDetailsService.GetUserDetailsByEmail(pemail); userdetails = userLoginDetailsService.GetUser(int.Parse(userlogin.UserLoginId.ToString())); userdetails.AlternativeEmailID = vendormaster.EmailId; userdetails.FirstName = vendormaster.ContactPerson; userdetails.UserPhone = vendormaster.ContactNumber; //userdetails = userLoginDetailsService.UpdateUserDetailEmail(userdetails, pemail); // Updating Email ID in User Detail Table userdetails = userLoginDetailsService.UpdateUserdetails(userdetails, userlogin.UserLoginId); return(Content("<script language='javascript' type='text/javascript'>alert('Info Updated');location.href='/admin/Vendors/SearchVendor'</script>")); } if (command == "Email") { VenorVenueSignUpService venorVenueSignUpService = new VenorVenueSignUpService(); userlogin.UserName = vendormaster.EmailId; var userResponse = venorVenueSignUpService.GetParticularUserdetails(pemail); if (userResponse != null) { string emailid = userlogin.UserName; if (userResponse.ActivationCode == null) { userlogin = userResponse; userlogin.ActivationCode = Guid.NewGuid().ToString(); userlogin = userLoginDetailsService.UpdateUserName(userlogin, emailid); userResponse.ActivationCode = userlogin.ActivationCode; } string activationcode = userResponse.ActivationCode; int userid = Convert.ToInt32(userResponse.UserLoginId); var userdetail = userLoginDetailsService.GetUser(userid); string name = userdetail.FirstName; // vendor mail activation begin string mailid = userlogin.UserName; var userR = userResponse;//venorVenueSignUpService.GetUserdetails(mailid); string pas1 = userR.Password; string url = Request.Url.Scheme + "://" + Request.Url.Authority + "/NUserRegistration/ActivateEmail1?ActivationCode=" + activationcode + "&&Email=" + emailid; FileInfo File = new FileInfo(Server.MapPath("/mailtemplate/WelcomeMessage.html")); string readFile = File.OpenText().ReadToEnd(); readFile = readFile.Replace("[ActivationLink]", url); readFile = readFile.Replace("[name]", name); readFile = readFile.Replace("[username]", mailid); readFile = readFile.Replace("[pass1]", pas1); string txtto = userlogin.UserName; string txtmessage = readFile;//readFile + body; string subj = "Welcome to Ahwanam"; // vendor mail activation end EmailSendingUtility emailSendingUtility = new EmailSendingUtility(); emailSendingUtility.Email_maaaahwanam(txtto, txtmessage, subj, null); return(Content("<script language='javascript' type='text/javascript'>alert('Invitation Sent to " + txtto + "');location.href='/admin/Vendors/SearchVendor'</script>")); } } return(View()); }