Exemple #1
0
        private void LoadData()
        {
            userAccountMaintBL = new UserAccountMaintBL();
            DataSet gridData = userAccountMaintBL.GetData(string.Empty, out errorId);

            userAccountMaintBL = null;

            if (gridData.Tables.Count != 0 && errorId != 2)
            {
                dtResponsibilityList = gridData.Tables[0];
                dtRoleList           = gridData.Tables[1];
                dtPaymentRoleList    = gridData.Tables[2];
                Session["FuzzyUserMaintUserList"] = gridData.Tables[3];

                Session["UserAccountResponsibility"] = dtResponsibilityList;
                ddlResponsibilityAdd.DataSource      = dtResponsibilityList;
                ddlResponsibilityAdd.DataTextField   = "responsibility_desc";
                ddlResponsibilityAdd.DataValueField  = "responsibility_code";
                ddlResponsibilityAdd.DataBind();
                ddlResponsibilityAdd.Items.Insert(0, new ListItem("-"));

                Session["UserAccountRole"] = dtRoleList;
                ddlroleAdd.DataSource      = dtRoleList;
                ddlroleAdd.DataTextField   = "role_desc";
                ddlroleAdd.DataValueField  = "role_id";
                ddlroleAdd.DataBind();
                ddlroleAdd.Items.Insert(0, new ListItem("-"));

                Session["UserAccountPaymentRole"] = dtPaymentRoleList;
                ddlPaymentRoleAdd.DataSource      = dtPaymentRoleList;
                ddlPaymentRoleAdd.DataTextField   = "role_desc";
                ddlPaymentRoleAdd.DataValueField  = "role_id";
                ddlPaymentRoleAdd.DataBind();
                ddlPaymentRoleAdd.Items.Insert(0, new ListItem("-"));

                if (gridData.Tables[4].Rows.Count == 0)
                {
                    gvUserAccount.DataSource    = gridData.Tables[4];
                    gvUserAccount.EmptyDataText = "No data found";
                    gvUserAccount.DataBind();
                }
                else
                {
                    Session["UserAccountData"] = gridData.Tables[4];
                    gvUserAccount.DataSource   = gridData.Tables[4];
                    gvUserAccount.DataBind();
                }
            }
            else if (gridData.Tables.Count == 0 && errorId != 2)
            {
                dtEmpty = new DataTable();
                gvUserAccount.DataSource    = dtEmpty;
                gvUserAccount.EmptyDataText = "No data found";
                gvUserAccount.DataBind();
            }
            else
            {
                ExceptionHandler("Error in loading grid data.", string.Empty);
            }
        }
Exemple #2
0
        private void UserSelected()
        {
            //WUIN-746 clearing sort hidden files
            hdnSortExpression.Value = string.Empty;
            hdnSortDirection.Value  = string.Empty;

            hdnChangeNotSaved.Value         = "N";
            hdnGridRowSelectedPrvious.Value = "";
            hdnChangeNotSavedAdd.Value      = "N";
            if (txtUserSearch.Text != string.Empty && (txtUserSearch.Text == "No results found" || hdnUserSearchSelected.Value == "N"))
            {
                msgView.SetMessage("Please select a valid user from the list", MessageType.Warning, PositionType.Auto);
                txtUserSearch.Text = string.Empty;
                return;
            }

            userAccountMaintBL = new UserAccountMaintBL();
            DataSet gridData = userAccountMaintBL.GetData(txtUserSearch.Text == string.Empty ? string.Empty : txtUserSearch.Text.Split('-')[1].ToString().Trim(), out errorId);

            userAccountMaintBL = null;

            if (gridData.Tables.Count != 0 && errorId != 2)
            {
                dtResponsibilityList = gridData.Tables[0];
                dtRoleList           = gridData.Tables[1];
                dtPaymentRoleList    = gridData.Tables[2];
                Session["FuzzyUserMaintUserList"] = gridData.Tables[3];

                if (gridData.Tables[4].Rows.Count == 0)
                {
                    gvUserAccount.DataSource    = gridData.Tables[4];
                    gvUserAccount.EmptyDataText = "No data found";
                    gvUserAccount.DataBind();
                }
                else
                {
                    gvUserAccount.DataSource = gridData.Tables[4];
                    gvUserAccount.DataBind();
                }
            }
            else if (gridData.Tables.Count == 0 && errorId != 2)
            {
                dtEmpty = new DataTable();
                gvUserAccount.DataSource    = dtEmpty;
                gvUserAccount.EmptyDataText = "No data found for the selected filter criteria";
                gvUserAccount.DataBind();
            }
            else
            {
                ExceptionHandler("Error in loading grid data", string.Empty);
            }
        }
Exemple #3
0
        protected void btnReset_Click(object sender, EventArgs e)
        {
            hdnSortExpression.Value         = string.Empty;
            hdnSortDirection.Value          = string.Empty;
            hdnChangeNotSaved.Value         = "N";
            hdnGridRowSelectedPrvious.Value = "";
            hdnChangeNotSavedAdd.Value      = "N";
            ClearAddFields();
            txtUserSearch.Text = string.Empty;


            userAccountMaintBL = new UserAccountMaintBL();
            DataSet gridData = userAccountMaintBL.GetData(string.Empty, out errorId);

            userAccountMaintBL = null;

            if (gridData.Tables.Count != 0 && errorId != 2)
            {
                dtResponsibilityList = gridData.Tables[0];
                dtRoleList           = gridData.Tables[1];
                dtPaymentRoleList    = gridData.Tables[2];
                Session["FuzzyUserMaintUserList"] = gridData.Tables[3];

                if (gridData.Tables[4].Rows.Count == 0)
                {
                    gvUserAccount.DataSource    = gridData.Tables[4];
                    gvUserAccount.EmptyDataText = "No data found";
                    gvUserAccount.DataBind();
                }
                else
                {
                    gvUserAccount.DataSource = gridData.Tables[4];
                    gvUserAccount.DataBind();
                }
            }
            else if (gridData.Tables.Count == 0 && errorId != 2)
            {
                dtEmpty = new DataTable();
                gvUserAccount.DataSource    = dtEmpty;
                gvUserAccount.EmptyDataText = "No data found";
                gvUserAccount.DataBind();
            }
            else
            {
                ExceptionHandler("Error in loading grid data.", string.Empty);
            }
        }