Пример #1
0
 public ActionResult Create(tb_PageDescription model)
 {
     try
     {
         //tb_emailsDescription model2 = new tb_emailsDescription();
         //model2.Description = model.Description;
         //model2.EmailModule_ = model.EmailModule_;
         //model2.EmailSubject = model.EmailSubject;
         db.tb_PageDescription.AddObject(model);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Пример #2
0
        public ActionResult Create(FormCollection collection, tb_ImagesHomeDhot model)
        {
            try
            {
                // TODO: Add insert logic here

                string filename = "";
                foreach (string inputTagName in Request.Files)
                {
                    HttpPostedFileBase file = Request.Files[inputTagName];
                    if (file.ContentLength < 60000000)
                    {
                        String FileExtension = Path.GetExtension(file.FileName).ToLower();
                        if (FileExtension == ".png" || FileExtension == ".jpeg" || FileExtension == ".jpg" || FileExtension == ".txt" || FileExtension == ".doc" ||
                            FileExtension == ".gif" || FileExtension == ".xls" || FileExtension == ".xlsx" || FileExtension == ".zip" || FileExtension == ".docx" || FileExtension == ".pdf")
                        {
                            string randName = emailSystem.CreateRandomPassword(5);
                            filename = randName + "_" + file.FileName;
                            string filePath = Path.Combine(HttpContext.Server.MapPath("~/uploads/"), filename);
                            file.SaveAs(filePath);
                        }
                    }
                }
                if (filename != "")
                {
                    model.ImagePath = filename;
                }

                db.tb_ImagesHomeDhot.AddObject(model);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Пример #3
0
        public ActionResult contactus(tb_ContactUs model, String captchatext)
        {
            try
            {
                //String sessionCap = Session["captcha"].ToString();

                const string emailregex = @"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*";
                if (!string.IsNullOrEmpty(model.EmailId) && !Regex.IsMatch(model.EmailId, emailregex))
                {
                    ViewData.ModelState.AddModelError("email", " Please enter a the valid e-mail ID!");
                }
                if (string.IsNullOrEmpty(model.EmailId))
                {
                    ViewData.ModelState.AddModelError("EmailID", " Please enter a the valid e-mail ID!");
                }
                if (string.IsNullOrEmpty(model.FirstName))
                {
                    ViewData.ModelState.AddModelError("FirstName", " Please enter a the First Name!");
                }
                if (string.IsNullOrEmpty(model.LastName))
                {
                    ViewData.ModelState.AddModelError("LastName", " Please enter a the Last Name!");
                }

                //if (string.IsNullOrEmpty(model.Location))
                //    ViewData.ModelState.AddModelError("Location", " Please enter a the Location!");

                if (string.IsNullOrEmpty(model.ContactNo))
                {
                    ViewData.ModelState.AddModelError("ContactNo", " Please enter a the Contact No!");
                }

                if (string.IsNullOrEmpty(model.Comments))
                {
                    ViewData.ModelState.AddModelError("Comments", " Please enter a the Comments!");
                }

                //if (string.IsNullOrEmpty(captchatext))
                //    ViewData.ModelState.AddModelError("captchatext", " Please enter the image in Red Color text !");

                //if (!String.Equals(captchatext, sessionCap, StringComparison.CurrentCultureIgnoreCase))
                //    ViewData.ModelState.AddModelError("captchatext", " Please enter the image in Red Color text !");

                if (!ViewData.ModelState.IsValid)
                {
                    return(View());
                }
                model.SystemDate = DateTime.Now;
                db.tb_ContactUs.AddObject(model);
                db.SaveChanges();

                string emailid = model.EmailId;

                //Sending email to concern Person
                //BY Lal
                string emailSubject = "";
                string emailBody    = "";
                //string emailHeader = clsCommon.getEmailHeader(emailid);
                //string emailFooter = clsCommon.getEmailBottom(emailid);
                //var item = (from m in db.tb_emailsDescriptions
                //            where m.setmoduleid == 29
                //            select m).Single();

                //emailSubject = item.EmailSubject;
                emailSubject = "Contact Us   "; //+model.subject ;
                //emailBody = item.Description;
                emailBody += "First Name :" + model.FirstName + " <br/>  <br/>";
                emailBody += "Last Name  :" + model.LastName + " <br/>  <br/>";
                emailBody += "Email Id   :" + model.EmailId + " <br/>  <br/>";
                emailBody += "Contact No :" + model.ContactNo + " <br/>  <br/>";
                emailBody += "Comments   :" + model.Comments + " <br/>  <br/>";

                string ForDispaly = emailBody;

                //emailBody = emailHeader + emailBody + emailFooter;

                //ViewData["emailstatus"] = item.Description;
                //ForDispaly = ForDispaly.Replace("Client", model.FirstName + " " + model.LastName);

                //  emailBody = emailBody.Replace("Client", model.FirstName + " " + model.LastName);
                emailid = model.EmailId;
                emailSystem.sendEmailold(emailid, emailSubject, emailBody);
                //End of EMail

                ViewData["message"] = "Email has sent to concern person";

                //  ViewData["message"] = ForDispaly;


                return(RedirectToAction("success"));
            }
            catch (Exception ce)
            {
                String message = ce.Message;
                ViewData["messageERR"] = message;
            }
            return(View());
        }
Пример #4
0
        public ActionResult Enquiry(tb_EnquiryDhot model, int id, String captchatext)
        {
            try
            {
                const string emailregex = @"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*";
                if (!string.IsNullOrEmpty(model.EmailId) && !Regex.IsMatch(model.EmailId, emailregex))
                {
                    ViewData.ModelState.AddModelError("email", " Please enter a the valid e-mail ID!");
                }
                if (string.IsNullOrEmpty(model.EmailId))
                {
                    ViewData.ModelState.AddModelError("EmailID", " Please enter a the valid e-mail ID!");
                }
                if (string.IsNullOrEmpty(model.FirstName))
                {
                    ViewData.ModelState.AddModelError("FirstName", " Please enter a the First Name!");
                }
                if (string.IsNullOrEmpty(model.ContactNo))
                {
                    ViewData.ModelState.AddModelError("ContactNo", " Please enter a the Contact No!");
                }
                if (string.IsNullOrEmpty(model.Comments))
                {
                    ViewData.ModelState.AddModelError("Comments", " Please enter a the Comments!");
                }
                if (!ViewData.ModelState.IsValid)
                {
                    return(View());
                }

                string filename = "";
                string filePath = "";
                foreach (string inputTagName in Request.Files)
                {
                    HttpPostedFileBase file = Request.Files[inputTagName];
                    if (file.ContentLength < 60000000)
                    {
                        String FileExtension = Path.GetExtension(file.FileName).ToLower();
                        if (FileExtension == ".png" || FileExtension == ".jpeg" || FileExtension == ".jpg" || FileExtension == ".txt" || FileExtension == ".doc" ||
                            FileExtension == ".gif" || FileExtension == ".xls" || FileExtension == ".xlsx" || FileExtension == ".zip" || FileExtension == ".docx" || FileExtension == ".pdf")
                        {
                            string randName = emailSystem.CreateRandomPassword(5);
                            filename = randName + "_" + file.FileName;
                            filePath = Path.Combine(HttpContext.Server.MapPath("~/uploads/"), filename);
                            file.SaveAs(filePath);
                        }
                    }
                }
                model.filepath   = filename;
                model.SystemDate = DateTime.Now;
                db.tb_EnquiryDhot.AddObject(model);
                db.SaveChanges();

                string emailid = model.EmailId;

                //Sending email to concern Person
                //BY Lal

                string emailBody = "";

                var    tb           = (from m in db.tb_PageDescription where m.Pageid == id select m).Single();
                string emailSubject = tb.Title;

                emailSubject = "Contact Us   " + tb.Title;
                emailBody   += " Name :" + model.FirstName + " <br/>  <br/>";
                emailBody   += "Email Id   :" + model.EmailId + " <br/>  <br/>";
                emailBody   += "Contact No :" + model.ContactNo + " <br/>  <br/>";
                emailBody   += "Comments   :" + model.Comments + " <br/>  <br/>";
                string ForDispaly = emailBody;
                //  string emailtodhot = "*****@*****.**";
                emailid = model.EmailId;
                // ====================================================================================================
                Attachment data = new Attachment(filePath);


                string bottom = "";
                emailBody += bottom;
                System.Net.Mail.MailMessage  mail = new System.Net.Mail.MailMessage();
                System.Net.NetworkCredential cred = new System.Net.NetworkCredential("*****@*****.**", "group4321");
                mail.To.Add("*****@*****.**");
                //mail.To.Add("*****@*****.**");

                mail.Subject    = emailSubject;
                mail.From       = new System.Net.Mail.MailAddress("*****@*****.**");
                mail.Priority   = MailPriority.High;
                mail.IsBodyHtml = true;
                mail.Body       = emailBody;
                mail.Attachments.Add(data);
                System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("relay-hosting.secureserver.net");
                smtp.UseDefaultCredentials = false;
                smtp.Credentials           = cred;
                smtp.EnableSsl             = false;
                smtp.Port = 25;
                smtp.Send(mail);


                // ========================================================================
                //emailSystem.sendEmailold(emailtodhot, emailSubject, emailBody );

                string emailbodytoClient = "";
                emailbodytoClient  = " Thanks for your following information, We will  get back to you soon <br/> <br/>";
                emailbodytoClient += emailBody;
                emailbodytoClient += " <br/> <br/> Thanks <br/> <br/> Dhot Group of Services Inc. Team ";
                emailSystem.sendEmailold(emailid, emailSubject, emailbodytoClient);

                ViewData["message"] = "Email has sent to concern person";

                return(RedirectToAction("success"));
            }
            catch (Exception ce)
            {
                String message = ce.Message;
                ViewData["messageERR"] = message;
            }
            return(View());
        }
Пример #5
0
        // public ActionResult Image()
        // {
        //  var builder = new XCaptcha.ImageBuilder();
        //var result = builder.Create();
        //Session.Add("captcha", result.Solution);

        //  return new FileContentResult(result.Image, result.ContentType);

        //    }
        //private void CounsellingEnquiry(Int32 enqid)
        //{
        //    String pass = emailSystem.CreateRandomPassword(8);
        //    var model3 = (from m in db.tb_Counsellings
        //                  where m.ID == enqid
        //                  select m);

        //    if (model3.Count() > 0)
        //    {

        //        var model = (from m in db.tb_Counsellings
        //                     where m.ID == enqid
        //                     select m).Single();



        //        var model1 = (from m in db.pms_UserMasters
        //                      where m.EmailID == model.EmailID
        //                      select m);

        //        if (model1.Count() == 0)
        //        {
        //            tb_UserMaster pms = new tb_UserMaster();
        //            pms.CompanyID = 0;
        //            pms.FirstName = model.FirstName;
        //            pms.LastName = model.LastName;
        //            pms.MiddleName = "";
        //            pms.ProfileName = model.FirstName;
        //            pms.UserMainCateID = 3;
        //          //  pms.ReferUserID = 3;
        //            pms.ConfirmPassword = pass;
        //            pms.UserPassword = pass;
        //            pms.ContactNo = "";
        //            pms.EmailID = model.EmailID;
        //            pms.Picture = "BlankMan.png";
        //         //   pms.ProjectCategoryid = 4;

        //            pms.CreateDate = DateTime.Now;
        //            pms.IpAddress = Request.ServerVariables["REMOTE_ADDR"].ToString();
        //            pms.ModifiedDate = DateTime.Now;
        //            pms.CompanyID = 0;
        //            pms.Groupid = 0;
        //            pms.UserCateID = 0;
        //            pms.LastLogin = DateTime.Now;
        //            pms.ConfirmDate = DateTime.Now;
        //            //pms.ValidFrom = DateTime.Now;
        //            //pms.ValidUpTo = DateTime.Now.AddDays(365);

        //            //pms.ReferUserID = Convert.ToInt32(model.CreatedBy);
        //            //pms.ConfirmID = true;
        //            //pms.DeletedBy = "";
        //            //pms.DeleteStatus = "N";
        //            //pms.DeletionDate = DateTime.Now;
        //            pms.LastLogin = DateTime.Now;

        //            //pms.AvtarPicture = "default_avtar1.jpg";

        //            //pms.CityID = model.DistrictId;
        //            //pms.StateID = model.StateId;
        //            //pms.CountryID = model.countryid;

        //            //pms.UserAddress = model.Address;
        //            //pms.ContactNo = model.Cell;



        //            pms.Terms = true;
        //            db.tb_UserMasters.InsertOnSubmit(pms);
        //            db.SubmitChanges();

        //            var model21 = (from m in db.tb_UserMasters
        //                           where m.UserID == pms.UserID
        //                           select m).Single();
        //          //  model21.promocode = 1234 + pms.UserID;
        //            db.SubmitChanges();
        //            var tmodel = (from m in db.tb_emailsDescriptions
        //                          where m.Autoid == 2
        //                          select m).Single();

        //            string desc = tmodel.Description;

        //            desc = desc.Replace("UserID", pms.EmailID);
        //            desc = desc.Replace("PassWord", pms.UserPassword);
        //            desc = desc.Replace("Pcode", model21.promocode.ToString());

        //            desc = desc.Replace("DearClient", "Dear " + pms.ProfileName + " [" + pms.EmailID + "]");
        //            clsCommon.SendEmailCurrentFormat(pms.EmailID, 2, 99999, Convert.ToInt32(pms.UserID), 0, 0, 0, desc, tmodel.EmailSubject, Request.ServerVariables["REMOTE_ADDR"].ToString());
        //            Session.Add("pmsuserid", pms.UserID);
        //            Session.Add("pmspromocode", pms.promocode);
        //            Session.Add("pmsusername", pms.AvtarName);
        //            Session.Add("emailid", pms.EmailID);
        //            Session.Add("cateid", pms.UserMainCateID);
        //            Session.Add("moduleid", 0);
        //            Session.Add("groupid", pms.Groupid);
        //            Session.Add("Imagepath", pms.AvtarPicture);
        //            Session.Add("projectcategory", pms.ProjectCategoryid);

        //            Session.Add("ProjectCategoryid", pms.ProjectCategoryid);
        //            model.ReferID = pms.UserID;

        //            db.SubmitChanges();

        //            var model111 = (from m in db.tb_DocumentMasters
        //                            where m.EqnuiryId == enqid
        //                            select m);
        //            if (model111.Count() > 0)
        //            {
        //                var model112 = (from m in db.tb_DocumentMasters
        //                                where m.EqnuiryId == enqid
        //                                select m).Single();

        //                model112.UserID = pms.UserID;
        //                db.SubmitChanges();
        //            }

        //            var tmodeldesc = (from m in db.tb_emailsDescriptions
        //                              where m.Autoid == 45
        //                              select m).Single();

        //            string emailbody = tmodeldesc.Description;
        //            string emailSubject = tmodeldesc.EmailSubject;
        //            emailbody = emailbody.Replace("UserName", pms.ProfileName + "<br> [" + pms.EmailID + "]");
        //            emailSubject = emailSubject.Replace("Client", pms.ProfileName);
        //            //clsCommon.SendEmailCurrentFormat(pms.EmailID, 0, 99999, Convert.ToInt32(pms.UserID), 0, 0, 0, emailbody, emailSubject, Request.ServerVariables["REMOTE_ADDR"].ToString());


        //            // return RedirectToAction("profile", "profile", new { usertype = pms.UserMainCateID });

        //        }

        //    }

        //}
        //private void FranchiseeEnquiry(Int32 enqid)
        //{
        //    String pass = emailSystem.CreateRandomPassword(8);
        //    var model3 = (from m in db.tb_CounsellingFranchisees
        //                  where m.ID == enqid
        //                  select m);

        //    if (model3.Count() > 0)
        //    {

        //        var model = (from m in db.tb_CounsellingFranchisees
        //                     where m.ID == enqid

        //                     select m).Single();
        //        var model1 = (from m in db.pms_UserMasters
        //                      where m.EmailID == model.EmailID
        //                      select m);

        //        if (model1.Count() == 0)
        //        {
        //            tb_UserMaster pms = new tb_UserMaster();
        //            pms.CompanyID = 0;
        //            pms.FirstName = model.FirstName;
        //            pms.LastName = model.LastName;
        //            pms.MiddleName = "";
        //            pms.ProfileName = model.FirstName;
        //            //pms.UserMainCateID = 17;
        //            pms.UserMainCateID = 3;
        //            pms.ConfirmPassword = pass;
        //            pms.UserPassword = pass;
        //            pms.ContactNo = "";
        //            pms.EmailID = model.EmailID;
        //            pms.Picture = "BlankMan.png";
        //            //pms.ReferUserID = 3;
        //            pms.CreateDate = DateTime.Now;
        //            pms.IpAddress = Request.ServerVariables["REMOTE_ADDR"].ToString();
        //            pms.ModifiedDate = DateTime.Now;
        //            pms.CompanyID = 0;
        //            pms.Groupid = 0;
        //            pms.UserCateID = 0;
        //            pms.LastLogin = DateTime.Now;
        //            pms.ConfirmDate = DateTime.Now;
        //            //pms.ValidFrom = DateTime.Now;
        //            //pms.ValidUpTo = DateTime.Now.AddDays(365);

        //            //pms.ConfirmID = true;
        //            //pms.ProjectCategoryid = 4;
        //            //pms.DeletedBy = "";
        //            //pms.DeleteStatus = "N";
        //            //pms.DeletionDate = DateTime.Now;
        //            pms.LastLogin = DateTime.Now;
        //            pms.Terms = true;

        //            //pms.CityID = model.DistrictId;
        //            //pms.StateID = model.StateID;
        //            //pms.CountryID = model.countryid;

        //            //pms.CountryChain = model.countryid;
        //            //pms.DistrictChain = model.DistrictId;
        //            //pms.StateChain = model.StateID;

        //            //pms.UserAddress = model.Address;
        //            //pms.ContactNo = model.Cell;
        //            //pms.FranCategory = model.FranCategory;
        //            //pms.AvtarPicture = "default_avtar1.jpg";

        //            //db.pms_UserMasters.InsertOnSubmit(pms);
        //            db.SubmitChanges();

        //            var model21 = (from m in db.pms_UserMasters
        //                           where m.UserID == pms.UserID
        //                           select m).Single();
        //            model21.promocode = 1234 + pms.UserID;
        //            db.SubmitChanges();

        //            var tmodel = (from m in db.tb_emailsDescriptions
        //                          where m.Autoid == 2
        //                          select m).Single();

        //            string desc = tmodel.Description;

        //            desc = desc.Replace("UserID", pms.EmailID);
        //            desc = desc.Replace("PassWord", pms.UserPassword);
        //            desc = desc.Replace("Pcode", model21.promocode.ToString());

        //            desc = desc.Replace("DearClient", "Dear " + pms.ProfileName + " [" + pms.EmailID + "]");

        //            //clsCommon.SendEmailCurrentFormat(pms.EmailID, 2, 99999, Convert.ToInt32(pms.UserID), 0, 0, 0, desc, tmodel.EmailSubject, Request.ServerVariables["REMOTE_ADDR"].ToString());
        //            Session.Add("pmsuserid", pms.UserID);
        //            //Session.Add("pmspromocode", pms.promocode);
        //            //Session.Add("pmsusername", pms.AvtarName);
        //            Session.Add("emailid", pms.EmailID);
        //            Session.Add("cateid", pms.UserMainCateID);
        //            Session.Add("moduleid", 0);
        //            Session.Add("groupid", pms.Groupid);
        //            //Session.Add("Imagepath", pms.AvtarPicture);
        //            //Session.Add("projectcategory", pms.ProjectCategoryid);
        //            //Session.Add("ProjectCategoryid", pms.ProjectCategoryid);

        //            //Transfering Enquiry for Actual User
        //            model.ReferID = pms.UserID;
        //            db.SubmitChanges();
        //            ////Transfering Chain and Promotor Code

        //            ////District
        //            //if (model.FranCategory == 4)
        //            //{
        //            //    string strQuery = @"update pms_usermaster set businesscode=referuserid,referuserid=" + pms.UserID + " ,istrans = 1 where istrans = 0 and districtid=" + pms.DistrictChain;
        //            //    db.ExecuteCommand(strQuery);
        //            //}
        //            ////State Master
        //            //if (model.FranCategory == 5)
        //            //{
        //            //    string strQuery = @"update pms_usermaster set businesscode=referuserid,referuserid=" + pms.UserID + ",istrans = 1  where istrans = 0  and  stateid=" + pms.DistrictChain;
        //            //    db.ExecuteCommand(strQuery);
        //            //}


        //            //Instrucdtion email

        //            var tmodeldesc = (from m in db.tb_emailsDescriptions
        //                              where m.Autoid == 49
        //                              select m).Single();

        //            string emailbody = tmodel.Description;
        //            string emailSubject = tmodel.EmailSubject;
        //            emailbody = emailbody.Replace("UserName", pms.ProfileName + "<br> [" + pms.EmailID + "]");
        //            emailSubject = emailSubject.Replace("Franchisee", pms.ProfileName);
        //            //clsCommon.SendEmailCurrentFormat(pms.EmailID, 0, 99999, Convert.ToInt32(pms.UserID), 0, 0, 0, emailbody, emailSubject, Request.ServerVariables["REMOTE_ADDR"].ToString());


        //        }

        //    }

        //}
        public ActionResult confirm(Int32 id)
        {
            try
            {
                String results = "";

                if (id == 0)
                {
                    if (Request.QueryString["enqid"] != null)
                    {
                        Int32 cid     = 0;
                        Int32 enqtype = 0;



                        if (Request.QueryString["enqid"] != null)
                        {
                            cid = Convert.ToInt32(Request.QueryString["enqid"].ToString());
                        }
                        if (Request.QueryString["enqtype"] != null)
                        {
                            enqtype = Convert.ToInt32(Request.QueryString["enqtype"].ToString());
                        }

                        if (enqtype == 99)
                        {
                            // FranchiseeEnquiry(cid);
                        }
                        else
                        {
                            //CounsellingEnquiry(cid);
                            return(RedirectToAction("details", "ProcessEqnuiry", new { id = cid }));
                        }

                        var pms = (from m in db.tb_UserMaster
                                   where m.UserID == Convert.ToInt32(Session["pmsuserid"])
                                   select m).Single();

                        return(RedirectToAction("profile", "profile", new { usertype = pms.UserMainCateID }));
                    }
                    else
                    {
                        results = "Invalid Link !!!!!";
                    }
                }
                else
                {
                    var tb = (from c in db.tb_UserMaster where c.UserID == id && c.ConfirmID == false select c).Single();

                    if (tb != null)
                    {
                        tb_UserMaster pms = (from m in db.tb_UserMaster where m.UserID == id select m).Single();
                        pms.ConfirmID   = true;
                        pms.ConfirmDate = DateTime.Now;
                        //pms.ValidFrom = DateTime.Now;
                        //pms.ValidUpTo = DateTime.Now.AddDays(365);
                        //pms.AvtarPicture = "default_avtar1.jpg";

                        db.SaveChanges();
                        results = "User ID has been confirmed";


                        var tmodel = (from m in db.tb_emailsDescription
                                      where m.Autoid == 2
                                      select m).Single();

                        string desc = tmodel.Description;
                        desc = desc.Replace("UserID", pms.EmailID);
                        desc = desc.Replace("PassWord", pms.UserPassword);
                        //  desc = desc.Replace("Pcode", pms.promocode.ToString());
                        desc = desc.Replace("DearClient", "Dear " + pms.ProfileName + " [" + pms.EmailID + "]");

                        //emailSystem.sendComments(pms.EmailID, tmodel.EmailSubject, desc, "");
                        //clsCommon.SendEmailCurrentFormat(pms.EmailID,0, 99999, Convert.ToInt32(pms.UserID), 0, 0, 0, desc, tmodel.EmailSubject, Request.ServerVariables["REMOTE_ADDR"].ToString());

                        if (pms.UserMainCateID == 1)
                        {
                            var tmodeldesc = (from m in db.tb_emailsDescription
                                              where m.Autoid == 47
                                              select m).Single();

                            string emailbody    = tmodeldesc.Description;
                            string emailSubject = tmodeldesc.EmailSubject;
                            emailbody    = emailbody.Replace("UserName", pms.ProfileName + "<br> [" + pms.EmailID + "]");
                            emailSubject = emailSubject.Replace("PA", pms.ProfileName);
                            //clsCommon.SendEmailCurrentFormat(pms.EmailID, 0, 99999, Convert.ToInt32(pms.UserID), 0, 0, 0, emailbody, emailSubject, Request.ServerVariables["REMOTE_ADDR"].ToString());
                        }



                        //var model111 = (from m in db.tb_pageDescriptions
                        //                where
                        //                    m.Pageid == 19
                        //                select m).Single();

                        //   Session.Add("marqmessage", model111.Description);
                        Session.Add("pmsuserid", pms.UserID);
                        //Session.Add("pmspromocode", pms.promocode);
                        //Session.Add("pmsusername", pms.AvtarName);
                        Session.Add("cateid", pms.UserMainCateID);
                        Session.Add("moduleid", 0);


                        Session.Add("groupid", pms.Groupid);
                        //Session.Add("Imagepath", pms.AvtarPicture);
                        Session.Add("emailid", pms.EmailID);
                        //Session.Add("ProjectCategoryid", pms.ProjectCategoryid);

                        return(RedirectToAction("profile", "profile", new { usertype = 1 }));
                    }
                    else
                    {
                        var model111 = (from m in db.tb_emailsDescription
                                        where
                                        m.Autoid == 33
                                        select m).Single();

                        results = model111.Description;
                    }
                }

                ViewData["results"] = results;
            }
            catch (Exception ce)
            {
                // emailSystem.errorLog(ce.Message, Request.ServerVariables["REMOTE_ADDR"].ToString(), "Confirmation", id);
                var model111 = (from m in db.tb_emailsDescription
                                where
                                m.Autoid == 33
                                select m).Single();


                ViewData["results"] = model111.Description;
            }
            return(View());
        }