コード例 #1
0
        private void PopulateDropDowns()
        {
            statementTextMaintenanceBL = new StatementTextMaintenanceBL();
            DataSet dropdownListData = statementTextMaintenanceBL.GetDropDownData(out errorId);

            statementTextMaintenanceBL = null;

            if (dropdownListData.Tables.Count != 0 && errorId != 2)
            {
                ddlCompany.DataTextField  = "com_name";
                ddlCompany.DataValueField = "com_number";
                ddlCompany.DataSource     = dropdownListData.Tables[0];
                ddlCompany.DataBind();
                ddlCompany.Items.Insert(0, new ListItem("-"));
            }
            else
            {
                ExceptionHandler("Error in loading the dropdown list values.", string.Empty);
            }
        }
コード例 #2
0
        private void BindGridViewData()
        {
            //WUIN-746 clearing sort hidden files
            hdnSortExpression.Value = string.Empty;
            hdnSortDirection.Value  = string.Empty;

            statementTextMaintenanceBL = new StatementTextMaintenanceBL();
            DataSet statementTextDetails = statementTextMaintenanceBL.GetStatementTextDetails(ddlCompany.SelectedValue, out errorId);

            statementTextMaintenanceBL = null;
            if (statementTextDetails.Tables.Count != 0 && errorId != 2)
            {
                Session["StmntTextData"]          = statementTextDetails.Tables[0];
                gvStatementTextDetails.DataSource = statementTextDetails.Tables[0];
                gvStatementTextDetails.DataBind();
            }
            else
            {
                ExceptionHandler("Error in fetching data", string.Empty);
            }
        }
コード例 #3
0
        protected void btnSaveChanges_Click(object sender, EventArgs e)
        {
            try
            {
                Array modifiedRowList = ModifiedRowsList();
                if (modifiedRowList.Length == 0)
                {
                    msgView.SetMessage("No changes made to save!", MessageType.Warning, PositionType.Auto);
                    return;
                }

                StatementTextMaintenanceBL statementTextMaintenanceBL = new StatementTextMaintenanceBL();
                DataSet saveStatementTextDetails = statementTextMaintenanceBL.SaveStatementTextDetails(ddlCompany.SelectedValue, modifiedRowList, Convert.ToString(Session["UserCode"]), out errorId);
                statementTextMaintenanceBL = null;

                if (errorId == 2 || saveStatementTextDetails.Tables.Count == 0)
                {
                    ExceptionHandler("Error in saving statement text details", string.Empty);
                }
                else if (saveStatementTextDetails.Tables[0].Rows.Count == 0)
                {
                    LoadGridData();
                }
                else
                {
                    Session["StmntTextData"]          = saveStatementTextDetails;
                    gvStatementTextDetails.DataSource = saveStatementTextDetails;
                    gvStatementTextDetails.DataBind();
                }
            }

            catch (Exception ex)
            {
                ExceptionHandler("Error in saving Statement Text Details", ex.Message);
            }
        }