public JsonResult EmailExists(string LEmailId) { BALCommon CSvc = new BALCommon(ConStr); OragnisationMaster master = new OragnisationMaster(); master = CSvc.GetOragnisationAlready(LEmailId); return(Json(!String.Equals(LEmailId, master.LEmailId, StringComparison.OrdinalIgnoreCase))); }
public OragnisationMaster GetOragnisationAlready(string LEmailId) { BALCommon bal = new BALCommon(ConStr); return(bal.GetOragnisationAlready(LEmailId)); }
public ActionResult Create(SignupModel model, FormCollection collection) { BALCommon CSvc = new BALCommon(ConStr); OragnisationMaster master = new OragnisationMaster(); //model.CountryList = CSvc.GetCountryList(0); //model.CityList = CSvc.GetCityList(0, 0); //model.StateList = CSvc.GetStateList(0, 0); if (ModelState.IsValid) { try { master = CSvc.GetOragnisationAlready(model.LEmailId); if (master.OMID == 0) { HttpPostedFileBase empimg = Request.Files["emppathimage"]; string folderpath = Constants.EMPATTACHMENT; if (empimg.ContentLength > 0) { string guidstring = Guid.NewGuid().ToString(); string _FileName = Path.GetFileName(empimg.FileName); string filepath = Path.Combine(Server.MapPath(folderpath) + guidstring + "_" + _FileName); string dbpath = Path.Combine(folderpath + guidstring + "_" + _FileName); empimg.SaveAs(filepath); master.OrgImage = dbpath; } else { string _FileName = "schooldummylogo.png"; string dbpath = Path.Combine(folderpath + _FileName); master.OrgImage = dbpath; } master.Oname = model.Oname; master.BOAddress = model.BOAddress; master.BOAddress2 = model.BOAddress2; master.BOCity = model.CITY_ID; master.BOPincode = model.BOPincode; master.LCountry = model.COUNTRY_ID; master.LState = model.STATE_ID; master.LDistict = model.LDistict; master.LArea = model.LArea; master.LEmailId = model.LEmailId; master.LMobile = model.LMobile; master.LPhone = model.LPhone; master.LWebsite = model.LWebsite; master.OAfficilate = model.OAfficilate; master.OlicNo = model.OlicNo; master.OTaxNo = model.OTaxNo; master.OPanNo = model.OPanNo; master.OContactNo = model.OContactNo; master.IsActive = false; master.Createddate = DateTime.Now; master.Modifieddate = DateTime.Now; master.CreatedBy = "EndUser"; master.ModifiedBy = "EndUser"; master.Otype = "INS"; // to check int _retua = CSvc.OragnasitionBasicopation(master); if (_retua > 0) { string Password = Utility.GenerateRandomPassword(); WebSecurity.CreateUserAndAccount(master.LEmailId, Password, new { Name = master.OContactNo, Mobile = master.LMobile, EmailId = master.LEmailId, Address = master.BOAddress, RoleId = 1, CITY_ID = master.BOCity, STATE_ID = master.LState, COUNTRY_ID = master.LCountry, ISACTIVE = 0, SchoolID = _retua }); CSvc.Firstuserconfigure(_retua);//first user configure //TempData[Constants.MessageInfo.SUCCESS] = Constants.Orgnisation_ADD_SUCCESS; #region SendMail MailDetails _MailDetails = new MailDetails(); _MailDetails.ToMailIDs = master.LEmailId; _MailDetails.HTMLBody = true; _MailDetails.Subject = "Organisation Registration"; _MailDetails.Body = BALMail.TemplateOrganisation(master, AESEncrytDecry.EncryptStringAES(Password)); if (BALMail.SendMail(_MailDetails)) { TempData[Constants.MessageInfo.SUCCESS] = Constants.Orgnisation_ADD_SUCCESS + ", Please check your mail inbox for more information."; } else { TempData[Constants.MessageInfo.SUCCESS] = Constants.Orgnisation_ADD_SUCCESS; } #endregion SendMail return(RedirectToAction("login")); } } else { TempData[Constants.MessageInfo.SUCCESS] = "Orgnisation is already Exist !"; return(RedirectToAction("Create")); } } catch (Exception ex) { WebSecurity.Logout(); ExecptionLogger.FileHandling("Account(Create_Post)", "Error_014", ex, "Account"); } } return(View(model)); }