Exemple #1
0
        protected void CurrentRowTextBox_OnTextChanged(object sender, EventArgs e)
        {
            TextBox t = (TextBox)sender;

            try
            {
                DataPagertxtValue = Convert.ToInt32(t.Text);
            }
            catch
            {
                LoggedIn master = (LoggedIn)this.Master;
                master.ShowMessage("Value Out of Range", false);
                return;
            }

            if (t.Text == "")
            {
                return;
            }


            if (DataPagertxtValue <= UserDataPager.TotalRowCount && DataPagertxtValue > 0)
            {
                UserDataPager.SetPageProperties(Convert.ToInt32(t.Text) - 1,
                                                UserDataPager.PageSize, true);
                bindLVUser();
                recalcNoOfPages();
            }
            else
            {
                LoggedIn master = (LoggedIn)this.Master;
                master.ShowMessage("Incorrect Input", false);
            }
        }
Exemple #2
0
        protected void PageJump_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            DropDownList PageJumpDDL = (DropDownList)sender;
            int          pageNo      = Convert.ToInt32(PageJumpDDL.SelectedValue);

            int startRowIndex = (pageNo - 1) * UserDataPager.PageSize;

            UserDataPager.SetPageProperties(startRowIndex, UserDataPager.PageSize, true);
            recalcNoOfPages();
        }
Exemple #3
0
        protected void btnDeleteYes_Click(object sender, EventArgs e)
        {
            if (!commonBAL.isUserAuthorisedForPageFunc(LoggedInUser.UserId, thisPageName, "delete"))
            {
                LoggedIn master = (LoggedIn)this.Master;
                master.ShowMessage("You are not authorised to perform this function. Please contact system administrator.", false);
                return;
            }
            UserBE  user    = new UserBE();
            UserBAL userBAL = new UserBAL();

            user.UserId = Convert.ToInt32(hdnUserId.Value);

            if (userBAL.Delete(user))
            {
                if (lvUserList.Items.Count == 1)
                {
                    UserDataPager.SetPageProperties(UserDataPager.TotalRowCount - UserDataPager.PageSize - 1,
                                                    UserDataPager.PageSize, true);
                    bindLVUser();
                    recalcNoOfPages();
                    LoggedIn master = (LoggedIn)this.Master;
                    master.ShowMessage("User successfully deleted.", true);
                }
                else
                {
                    lvUserList.EditIndex = -1;
                    bindLVUser();
                    recalcNoOfPages();
                    LoggedIn master = (LoggedIn)this.Master;
                    master.ShowMessage("User successfully deleted.", true);
                }
            }
            else
            {
                LoggedIn master = (LoggedIn)this.Master;
                master.ShowMessage("Sorry You cannot delete this User because it is already in use", false);
            }
            // Hide the ModalPopup.
            //this.mpe_DeleteUser.Hide();
        }