コード例 #1
0
        private static string OrganisationBody(OragnisationMaster _OragnisationMaster, string Password)
        {
            string Body = "";

            try
            {
                Body += "Thank you for registering. ";
                Body += "<br /><br />";
                Body += "Please find credentials to login.";
                Body += "<br />";
                Body += "<b>User Name: </b>" + _OragnisationMaster.LEmailId;
                Body += "<br />";
                Body += "<b>Password: </b>" + AESEncrytDecry.DecryptStringAES(Password);
                Body += "<br /><br />";
                Body += "<b>URL: </b>" + ConfigurationManager.AppSettings["WebSite"].ToString().Trim();
                Body += "<br /><br />";
                Body += "Our executive will contact you and after verification, we will activate your account.";
                Body += "<br />";
                Body += "Note:- Please change your password after successful login.";
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("BALMail(Header)", "Error_014", ex, "BALMail");
                Body = "";
            }
            return(Body);
        }
コード例 #2
0
        public JsonResult EmailExists(string LEmailId)
        {
            OragnisationMaster master = new OragnisationMaster();

            master = CSvc.GetOragnisationAlready(LEmailId);
            return(Json(!String.Equals(LEmailId, master.LEmailId, StringComparison.OrdinalIgnoreCase)));
        }
コード例 #3
0
        public OragnisationMaster GetOragnisationAlready(string LEmailId)
        {
            OragnisationMaster _lst = new OragnisationMaster();

            try
            {
                cmd             = new SqlCommand("SP_Orgnisationmexist");
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@LEmailId", LEmailId);
                var reader = DBHelper.ExecuteReader(cmd);
                while (reader.Read())
                {
                    _lst.OMID         = DBNull.Value != reader["OMID"] ? (int)reader["OMID"] : default(int);
                    _lst.Oname        = DBNull.Value != reader["Oname"] ? (string)reader["Oname"] : default(string);
                    _lst.BOAddress    = DBNull.Value != reader["BOAddress"] ? (string)reader["BOAddress"] : default(string);
                    _lst.BOAddress2   = DBNull.Value != reader["BOAddress2"] ? (string)reader["BOAddress2"] : default(string);
                    _lst.BOCity       = DBNull.Value != reader["BOCity"] ? (int)reader["BOCity"] : default(int);
                    _lst.BOPincode    = DBNull.Value != reader["BOPincode"] ? (string)reader["BOPincode"] : default(string);
                    _lst.LCountry     = DBNull.Value != reader["LCountry"] ? (int)reader["LCountry"] : default(int);
                    _lst.LState       = DBNull.Value != reader["LState"] ? (int)reader["LState"] : default(int);
                    _lst.LDistict     = DBNull.Value != reader["LDistict"] ? (string)reader["LDistict"] : default(string);
                    _lst.LArea        = DBNull.Value != reader["LArea"] ? (string)reader["LArea"] : default(string);
                    _lst.LEmailId     = DBNull.Value != reader["LEmailId"] ? (string)reader["LEmailId"] : default(string);
                    _lst.LMobile      = DBNull.Value != reader["LMobile"] ? (string)reader["LMobile"] : default(string);
                    _lst.LPhone       = DBNull.Value != reader["LPhone"] ? (string)reader["LPhone"] : default(string);
                    _lst.LWebsite     = DBNull.Value != reader["LWebsite"] ? (string)reader["LWebsite"] : default(string);
                    _lst.OAfficilate  = DBNull.Value != reader["OAfficilate"] ? (string)reader["OAfficilate"] : default(string);
                    _lst.OlicNo       = DBNull.Value != reader["OlicNo"] ? (string)reader["OlicNo"] : default(string);
                    _lst.OTaxNo       = DBNull.Value != reader["OTaxNo"] ? (string)reader["OTaxNo"] : default(string);
                    _lst.OPanNo       = DBNull.Value != reader["OPanNo"] ? (string)reader["OPanNo"] : default(string);
                    _lst.OContactNo   = DBNull.Value != reader["OContactNo"] ? (string)reader["OContactNo"] : default(string);
                    _lst.IsActive     = DBNull.Value != reader["IsActive"] ? (bool)reader["IsActive"] : default(bool);
                    _lst.Createddate  = DBNull.Value != reader["Createddate"] ? (DateTime)reader["Createddate"] : default(DateTime);
                    _lst.CreatedBy    = DBNull.Value != reader["CreatedBy"] ? (string)reader["CreatedBy"] : default(string);
                    _lst.Modifieddate = DBNull.Value != reader["Modifieddate"] ? (DateTime)reader["Modifieddate"] : default(DateTime);
                    _lst.ModifiedBy   = DBNull.Value != reader["ModifiedBy"] ? (string)reader["ModifiedBy"] : default(string);
                }
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("DALCommon(OragnasitionBasicopation)", "Error_014", ex, "DALCommon");
            }
            finally
            {
                cmd.Dispose();
            }
            return(_lst);
        }
コード例 #4
0
        public int OragnasitionBasicopation(OragnisationMaster _Omaster)
        {
            int rettype = -1;

            try
            {
                cmd             = new SqlCommand("SP_Orgnisationmaster");
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@OMID", _Omaster.OMID);
                cmd.Parameters.AddWithValue("@Oname", _Omaster.Oname);
                cmd.Parameters.AddWithValue("@BOAddress", _Omaster.BOAddress);
                cmd.Parameters.AddWithValue("@BOAddress2", _Omaster.BOAddress2);
                cmd.Parameters.AddWithValue("@BOCity", _Omaster.BOCity);
                cmd.Parameters.AddWithValue("@BOPincode", _Omaster.BOPincode);
                cmd.Parameters.AddWithValue("@LCountry", _Omaster.LCountry);
                cmd.Parameters.AddWithValue("@LState", _Omaster.LState);
                cmd.Parameters.AddWithValue("@LDistict", _Omaster.LDistict);
                cmd.Parameters.AddWithValue("@LArea", _Omaster.LArea);
                cmd.Parameters.AddWithValue("@LEmailId", _Omaster.LEmailId);
                cmd.Parameters.AddWithValue("@LMobile", _Omaster.LMobile);
                cmd.Parameters.AddWithValue("@LPhone", _Omaster.LPhone);
                cmd.Parameters.AddWithValue("@LWebsite", _Omaster.LWebsite);
                cmd.Parameters.AddWithValue("@OAfficilate", _Omaster.OAfficilate);
                cmd.Parameters.AddWithValue("@OlicNo", _Omaster.OlicNo);
                cmd.Parameters.AddWithValue("@OTaxNo", _Omaster.OTaxNo);
                cmd.Parameters.AddWithValue("@OPanNo", _Omaster.OPanNo);
                cmd.Parameters.AddWithValue("@OContactNo", _Omaster.OContactNo);
                cmd.Parameters.AddWithValue("@IsActive", _Omaster.IsActive);
                cmd.Parameters.AddWithValue("@Createddate", _Omaster.Createddate);
                cmd.Parameters.AddWithValue("@CreatedBy", _Omaster.CreatedBy);
                cmd.Parameters.AddWithValue("@Modifieddate", _Omaster.Modifieddate);
                cmd.Parameters.AddWithValue("@ModifiedBy", _Omaster.ModifiedBy);
                cmd.Parameters.AddWithValue("@OrgImage", _Omaster.OrgImage);
                cmd.Parameters.AddWithValue("@Otype", _Omaster.Otype);
                rettype = DBHelper.ExecuteNonQuery(cmd);
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("DALCommon(OragnasitionBasicopation)", "Error_014", ex, "DALCommon");
            }
            finally
            {
                cmd.Dispose();
            }
            return(rettype);
        }
コード例 #5
0
        public static string TemplateOrganisation(OragnisationMaster _OragnisationMaster, string Password)
        {
            string HTML = "";

            try
            {
                HTML += Header(_OragnisationMaster.OContactNo);
                HTML += "<br /><br />";
                HTML += OrganisationBody(_OragnisationMaster, Password);
                HTML += "<br /><br /><br /><br />";
                HTML += Footer("igenussolution Team");
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("BALMail(TemplateOrganisation)", "Error_014", ex, "BALMail");
                HTML = "";
            }
            return(HTML);
        }
コード例 #6
0
        public int OragnasitionBasicopation(OragnisationMaster _OM)
        {
            DALCommon dal = new DALCommon(ConStr);

            return(dal.OragnasitionBasicopation(_OM));
        }
コード例 #7
0
        public int OragnasitionBasicopation(OragnisationMaster _OM)
        {
            BALCommon bal = new BALCommon(ConStr);

            return(bal.OragnasitionBasicopation(_OM));
        }
コード例 #8
0
        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));
        }
コード例 #9
0
        public ActionResult Create(SignupModel model, FormCollection collection)
        {
            OragnisationMaster master = new OragnisationMaster();

            model.CountryList = CSvc.GetCountryList();
            model.CityList    = CSvc.GetCityList(0);
            model.StateList   = CSvc.GetStateList(0);
            if (ModelState.IsValid)
            {
                try
                {
                    HttpPostedFileBase empimg = Request.Files["emppathimage"];
                    if (empimg.ContentLength > 0)
                    {
                        string _FileName  = Path.GetFileName(empimg.FileName);
                        string folderpath = Constants.EMPATTACHMENT;
                        string guidstring = Guid.NewGuid().ToString();
                        string filepath   = Path.Combine(Server.MapPath(folderpath) + guidstring + "_" + _FileName);
                        string dbpath     = Path.Combine(folderpath + guidstring + "_" + _FileName);
                        empimg.SaveAs(filepath);
                        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)
                    {
                        WebSecurity.CreateUserAndAccount(master.LEmailId, "P@ssword1", 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 });
                        TempData[Constants.MessageInfo.SUCCESS] = Constants.Orgnisation_ADD_SUCCESS;
                        ModelState.Values.Clear();
                    }
                }
                catch (Exception ex)
                {
                    WebSecurity.Logout();
                    ExecptionLogger.FileHandling("Account(Create_Post)", "Error_014", ex, "Account");
                }
            }

            return(View(model));
        }