Esempio n. 1
0
 protected void LoginButton_Click(object sender, EventArgs e)
 {
     _um.EmailId  = Login1.UserName.Trim();
     _um.Password = Login1.Password.Trim();
     _dt          = _obj.checklogin(_um);
     foreach (DataRow row in _dt.Rows)
     {
         FormsAuthentication.RedirectFromLoginPage(row["UserName"].ToString(), false);
         Session.Add("Status", "SignOut");
         Session["UserId"]     = row["UserId"].ToString();
         Session["UserName"]   = row["UserName"].ToString();
         Session["UserTypeId"] = row["UserTypeId"].ToString();
         Session["CompanyId"]  = row["CompanyId"].ToString();
         if (Convert.ToInt16(row["UserTypeId"]) == Data.Constants.SuperAdmin)
         {
             Response.Redirect("superadmin/Dashboard.aspx");
         }
         else
         {
             Response.Redirect("companyadmin/Dashboard.aspx");
         }
     }
 }