Пример #1
0
        //JIRA-746 CHanges by Ravi on 05/03/2019 -- End

        #endregion Events

        #region Methods

        private void LoadData()
        {
            accountTypeMaintenanceBL = new AccountTypeMaintenanceBL();
            DataSet initialData = accountTypeMaintenanceBL.GetInitialData(out errorId);

            accountTypeMaintenanceBL = null;

            if (initialData.Tables.Count != 0 && errorId != 2)
            {
                Session["AccountTypeData"]   = initialData.Tables[0];
                Session["AccountTypeList"]   = initialData.Tables[1];
                Session["AccSourceTypeList"] = initialData.Tables[2];

                BindGrid(initialData.Tables[0]);

                ddlAccountTypeDescInsert.DataSource     = initialData.Tables[1];
                ddlAccountTypeDescInsert.DataTextField  = "account_type_desc";
                ddlAccountTypeDescInsert.DataValueField = "account_type_id";
                ddlAccountTypeDescInsert.DataBind();
                ddlAccountTypeDescInsert.Items.Insert(0, new ListItem("-"));

                ddlSourceTypeInsert.DataSource     = initialData.Tables[2];
                ddlSourceTypeInsert.DataTextField  = "dropdown_text";
                ddlSourceTypeInsert.DataValueField = "dropdown_value";
                ddlSourceTypeInsert.DataBind();
                ddlSourceTypeInsert.Items.Insert(0, new ListItem("-"));
            }
            else
            {
                ExceptionHandler("Error in fetching data", string.Empty);
            }
        }
Пример #2
0
        protected void btnReset_Click(object sender, EventArgs e)
        {
            try
            {
                hdnSortExpression.Value = string.Empty;
                hdnSortDirection.Value  = string.Empty;

                accountTypeMaintenanceBL = new AccountTypeMaintenanceBL();
                DataSet initialData = accountTypeMaintenanceBL.GetInitialData(out errorId);
                accountTypeMaintenanceBL = null;

                if (initialData.Tables.Count != 0 && errorId != 2)
                {
                    Session["AccountTypeData"] = initialData.Tables[0];
                    Session["AccountTypeList"] = initialData.Tables[1];

                    BindGrid(initialData.Tables[0]);

                    ddlAccountTypeDescInsert.DataSource     = initialData.Tables[1];
                    ddlAccountTypeDescInsert.DataTextField  = "account_type_desc";
                    ddlAccountTypeDescInsert.DataValueField = "account_type_id";
                    ddlAccountTypeDescInsert.DataBind();
                    ddlAccountTypeDescInsert.Items.Insert(0, new ListItem("-"));
                }
                else
                {
                    ExceptionHandler("Error in fetching data", string.Empty);
                }

                txtAccountTypeSearch.Text              = string.Empty;
                txtAccountTypeCode.Text                = string.Empty;
                lblDisplayOrderInsert.Text             = string.Empty;
                cbConsolidInsert.Checked               = false;
                cbInIncludeInsert.Checked              = false;
                ddlAccountTypeDescInsert.SelectedIndex = 0;
                ddlSourceTypeInsert.SelectedIndex      = 0;
                hdnChangeNotSaved.Value                = "N";
                hdnInsertDataNotSaved.Value            = "N";
                hdnGridRowSelectedPrvious.Value        = null;
                hdnSearchText.Value = null;
            }
            catch (Exception ex)
            {
                ExceptionHandler("Error in reseting page.", ex.Message);
            }
        }