Esempio n. 1
0
        protected void btnsave_Click(object sender, EventArgs e)
        {
            int id = 0;

            if (ViewState["ID"] != null)
            {
                id = Convert.ToInt32(ViewState["ID"]);
            }
            _user = new Vendor.BO.User().GetData(id);
            try
            {
                RefreshObject();

                _user.Save();

                _message.Text     = "Data Saved Successfully";
                _message.CssClass = "MessageSuccess";

                if (id > 0)
                {
                    Response.Redirect("UserList.aspx");
                }
                else
                {
                    _user = new Vendor.BO.User();
                    RefreshControl();
                }
            }
            catch (Exception exp)
            {
                _message.Text     = exp.Message;
                _message.CssClass = "MessageError";
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     Vendor.BO.User user = (Vendor.BO.User)Session["User"];
     if (user == null)
     {
         Response.Redirect("Login.aspx");
     }
     lblUserName.Text = user.UserName;
 }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _message = (Label)Master.FindControl("lblMessage");
            Label header = (Label)Master.FindControl("lblHeader");

            header.Text = "User Details";

            if (!IsPostBack)
            {
                int id = 0;
                if (Page.Request.QueryString["ID"] != null)
                {
                    id = Convert.ToInt32(Page.Request.QueryString["ID"]);
                }
                ViewState["ID"] = id;

                _user = new Vendor.BO.User().GetData(id);

                RefreshControl();
            }
        }
        protected void btnSignin_Click(object sender, EventArgs e)
        {
            if (txtbxUserID.Text.Length > 0)
            {
                Vendor.BO.User user = new Vendor.BO.User();
                user = user.GetData(txtbxUserID.Text);

                if (user == null)
                {
                    this.lblMsg.Text = "Invalid User ID";
                    return;
                }
                if (user.Password != txtbxPassword.Text)
                {
                    this.lblMsg.Text = "Invalid Password.";
                    return;
                }

                Session["User"] = user;
                Response.Redirect("VendorList.aspx");
            }
        }