Пример #1
0
    protected void Page_PreRender(object sender, EventArgs e)
    {
        string username = Request.Form["UserID"];
        string password = Request.Form["Password"];

        if (username != null)
        {

            MembershipController mbsController = new MembershipController();
            if (mbsController.ValidateUser(username, password))
            {
                FormsAuthentication.RedirectFromLoginPage(username, false);
            }
            else
            {
                //if (mbsController.isSuspended(username))
                //{
                //    Response.Redirect(HostPortal + "LoginPage.aspx?ReturnUrl=%2fCINAPQRI%2f&Error=" + "Your Account is locked");
                //}

                //if (Convert.ToBoolean(HttpContext.Current.Session["isExpired"]))
                //{
                //    Session.Remove("isExpired");
                //    Response.Redirect(HostPortal + "LoginEsp.aspx?PassExpired=true&Code=" + HttpContext.Current.Session["CodeGUID"].ToString());

                //}

                //Response.Redirect(HostPortal + "LoginPage.aspx?ReturnUrl=%2fCINAPQRI%2f&Error=" + "Invalid Login");
            }
        }
    }
Пример #2
0
 protected void ddlAssignedTo_SelectedIndexChanged(object sender, EventArgs e)
 {
     MembershipController membership = new MembershipController();
     UserInfo assingto = membership.GetUserById(Convert.ToInt32(ddlAssignedTo.SelectedValue));
     EntCategory.AssignedTo = assingto;
     tbxDefaultEmail.Text = EntCategory.AssignedTo.Email;
     tbxAlternativeEmail.Focus();
 }
Пример #3
0
 private void GetDataFromForm()
 {
     MembershipController membership = new MembershipController();
     EntCategory.Name = tbxName.Text;
     //EntCategory.AssignedTo = membership.GetUserById(Convert.ToInt32(ddlAssignedTo.SelectedValue));
     EntCategory.AlternativeMail = tbxAlternativeEmail.Text;
     EntCategory.EntStatus = new Status() { IdStatus = Convert.ToInt32(ddlStatus.SelectedValue), Name = ddlStatus.SelectedItem.Text };
 }
Пример #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         MembershipController mcontroller = new MembershipController();
         User entCurrenUser = (User)Session["currentUser"];
         EntTicket = new Ticket();
         EntTicket.CreatedBy = mcontroller.GetUserById(entCurrenUser.IdUser);
     }
 }
Пример #5
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        MembershipController membershipCntrllr = new MembershipController();
        GetDataFromForm();

        if (membershipCntrllr.Save(EntUser))
        {
            Response.Redirect("Default.aspx");
        }
    }
Пример #6
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        MembershipController membershipCntrllr = new MembershipController();
        GetDataFromForm();

        if (membershipCntrllr.Save(EntUser))
        {
            Response.Redirect("Default.aspx");
        }
        else
        {
            lblError.Visible = true;
            lblError.Text = "Error al guardar la información";
        }
    }
Пример #7
0
    protected void Page_PreRender(object sender, EventArgs e)
    {
        string username = Request.Form["UserID"];
        string password = Request.Form["Password"];

        if (username != null)
        {
            MembershipController mbsController = new MembershipController();
            if (mbsController.ValidateUser(username, password))
            {
                FormsAuthentication.RedirectFromLoginPage(username, false);
            }
            else
            {

            }
        }
    }
Пример #8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         MembershipController membershipCntrllr = new MembershipController();
         int IdUser = int.Parse(Request.Params["IdUser"]);
         if (IdUser > 0)
         {
             EntUser = membershipCntrllr.GetUserById(IdUser);
             rfvConfirmPassword.Enabled = false;
             rfvPassword.Enabled = false;
             SetDataToForm();
             tbxUserName.Focus();
         }
         else
         {
             EntUser = new UserInfo();
         }
         tbxUserName.Focus();
     }
 }