//
        // GET: /Home/
        public ActionResult Index()
        {

            if (Session["User"] != null)
            {
                User _user = (User)Session["User"];
                string pass = _user.Password;
                string pid = _user.PuId;
                string puid = pid.Substring(36, pid.Length - 36);
                ViewBag.PuId = puid;
                ViewBag.user = _user;
                Api.Team.Team ApiobjTeam = new Api.Team.Team();
                List<Domain.Myfashion.Domain.Groups> lstgroup = (List<Domain.Myfashion.Domain.Groups>)(new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize(ApiobjTeam.GetTeamByUserId(_user.Id.ToString()), typeof(List<Domain.Myfashion.Domain.Groups>)));
                foreach (Groups item in lstgroup)
                {
                    System.Web.HttpContext.Current.Session["group"] = item.Id;
                }
                return View();
            }
            else
            {
                return RedirectToAction("Index", "Index");
            }
        }
 //
 // GET: /Home/
 public ActionResult Index()
 {
     if (Session["User"] != null)
     {
         User   _user = (User)Session["User"];
         string pass  = _user.Password;
         string pid   = _user.PuId;
         string puid  = pid.Substring(36, pid.Length - 36);
         ViewBag.PuId = puid;
         ViewBag.user = _user;
         Api.Team.Team ApiobjTeam = new Api.Team.Team();
         List <Domain.Myfashion.Domain.Groups> lstgroup = (List <Domain.Myfashion.Domain.Groups>)(new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize(ApiobjTeam.GetTeamByUserId(_user.Id.ToString()), typeof(List <Domain.Myfashion.Domain.Groups>)));
         foreach (Groups item in lstgroup)
         {
             System.Web.HttpContext.Current.Session["group"] = item.Id;
         }
         return(View());
     }
     else
     {
         return(RedirectToAction("Index", "Index"));
     }
 }
        public ActionResult SignIn()
        {
            Session.Clear();
            Session.RemoveAll();
            User _user = (User)Session["User"];
             string str="";
             string returnmsg = "";
             try
             {
                 logger.Error("Avinash Login");
                 User user = new Domain.Myfashion.Domain.User();
                 string uname = Request.QueryString["username"].ToString();
                 string pass = Request.QueryString["password"].ToString();
                 Api.User.User obj = new Api.User.User();
                 string logindata = obj.Login(uname, pass);
                 str = logindata.Replace("\"", string.Empty).Trim();
                 if (str != "Not Exist" && !str.Equals("Email Not Exist"))
                 {
                     user = (User)(new JavaScriptSerializer().Deserialize(logindata, typeof(User)));
                     Api.Team.Team ApiobjTeam = new Api.Team.Team();
                     List<Domain.Myfashion.Domain.Groups> lstgroup = (List<Domain.Myfashion.Domain.Groups>)(new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize(ApiobjTeam.GetTeamByUserId(user.Id.ToString()), typeof(List<Domain.Myfashion.Domain.Groups>)));
                     foreach (Groups item in lstgroup)
                     {
                        System.Web.HttpContext.Current.Session["group"] = item.Id;
                     }
                     if (user == null)
                     {
                         returnmsg = "Invalid Email or Password";
                     }
                     else
                     {
                         Session["User"] = user;
                         returnmsg = "user";
                     }
                     return Content(returnmsg);
                     
                 }
                 else if (str.Equals("Email Not Exist"))
                 {
                     returnmsg = "Sorry, Socioboard doesn't recognize that username.";
                     return Content(returnmsg);

                 }
                 return Content(returnmsg);
             }
             catch (Exception ex)
             {
                 logger.Error("UserLogin >>" + ex.Message);
                 logger.Error("UserLogin >>" + ex.StackTrace);
                 return Content(str);

             }

        }
Example #4
0
        public ActionResult SignIn()
        {
            Session.Clear();
            Session.RemoveAll();
            User   _user     = (User)Session["User"];
            string str       = "";
            string returnmsg = "";

            try
            {
                logger.Error("Avinash Login");
                User          user      = new Domain.Myfashion.Domain.User();
                string        uname     = Request.QueryString["username"].ToString();
                string        pass      = Request.QueryString["password"].ToString();
                Api.User.User obj       = new Api.User.User();
                string        logindata = obj.Login(uname, pass);
                str = logindata.Replace("\"", string.Empty).Trim();
                if (str != "Not Exist" && !str.Equals("Email Not Exist"))
                {
                    user = (User)(new JavaScriptSerializer().Deserialize(logindata, typeof(User)));
                    Api.Team.Team ApiobjTeam = new Api.Team.Team();
                    List <Domain.Myfashion.Domain.Groups> lstgroup = (List <Domain.Myfashion.Domain.Groups>)(new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize(ApiobjTeam.GetTeamByUserId(user.Id.ToString()), typeof(List <Domain.Myfashion.Domain.Groups>)));
                    foreach (Groups item in lstgroup)
                    {
                        System.Web.HttpContext.Current.Session["group"] = item.Id;
                    }
                    if (user == null)
                    {
                        returnmsg = "Invalid Email or Password";
                    }
                    else
                    {
                        Session["User"] = user;
                        returnmsg       = "user";
                    }
                    return(Content(returnmsg));
                }
                else if (str.Equals("Email Not Exist"))
                {
                    returnmsg = "Sorry, Socioboard doesn't recognize that username.";
                    return(Content(returnmsg));
                }
                return(Content(returnmsg));
            }
            catch (Exception ex)
            {
                logger.Error("UserLogin >>" + ex.Message);
                logger.Error("UserLogin >>" + ex.StackTrace);
                return(Content(str));
            }
        }