Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                LoadEmployeeList();
            }
            lnkAddUser.Visible = !frmUser.Visible || frmUser.CurrentMode != FormViewMode.Insert;

            EdycjaPINu pinEdit = (frmUser.FindControl("pinEdit") as EdycjaPINu);

            if (pinEdit != null)
            {
                pinEdit.AdminMode(true);
                if (frmUser.CurrentMode == FormViewMode.Insert)
                {
                    pinEdit.ValidationGroup = "AddingUser";
                    pinEdit.EditMode(false);
                }
                else
                {
                    pinEdit.EditMode(true);
                    pinEdit.ValidationGroup = "ValidatePIN";
                }
            }

            this.SelectedUserChanged        += new EventHandler(edycjaUzytkownikow_SelectedUserChanged);
            definicjaZastepstw.CoverChanged += new EventHandler(definicjaZastepstw_CoverChanged);
        }
Exemplo n.º 2
0
        protected void lnkAddUser_Click(object sender, EventArgs e)
        {
            frmUser.ChangeMode(FormViewMode.Insert);
            frmUser.Visible            = true;
            definicjaZastepstw.Visible = false;
            SelectedUserID             = -1;

            EdycjaPINu pinEdit = (frmUser.FindControl("pinEdit") as EdycjaPINu);

            if (pinEdit != null)
            {
                pinEdit.AdminMode(true);
                if (frmUser.CurrentMode == FormViewMode.Insert)
                {
                    pinEdit.ValidationGroup = "AddingUser";
                    pinEdit.EditMode(false);
                }
                else
                {
                    pinEdit.EditMode(true);
                    pinEdit.ValidationGroup = "ValidatePIN";
                }
            }

            OnSelectedUserChanged();
        }
Exemplo n.º 3
0
        protected void gvUsersList_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            switch (e.CommandName)
            {
            case "Select":
                dsUser.SelectParameters.Clear();
                dsUser.SelectParameters.Add("idToz", gvUsersList.DataKeys[int.Parse(e.CommandArgument.ToString())].Value.ToString());
                frmUser.Visible = true;
                frmUser.ChangeMode(FormViewMode.Edit);
                frmUser.DataBind();

                SelectedUserID             = new UserDAO().GetUserID(new Guid(gvUsersList.DataKeys[int.Parse(e.CommandArgument.ToString())].Value.ToString()));
                definicjaZastepstw.Visible = true;

                EdycjaPINu pinEdit = (frmUser.FindControl("pinEdit") as EdycjaPINu);
                if (pinEdit != null)
                {
                    pinEdit.UserId = new Guid(dsUser.SelectParameters["idToz"].DefaultValue.ToString());
                    pinEdit.AdminMode(true);
                    if (frmUser.CurrentMode == FormViewMode.Insert)
                    {
                        pinEdit.ValidationGroup = "AddingUser";
                        pinEdit.EditMode(false);
                    }
                    else
                    {
                        pinEdit.EditMode(true);
                        pinEdit.ValidationGroup = "ValidatePIN";
                    }
                }

                OnSelectedUserChanged();

                break;



            default: break;
            }
        }