Beispiel #1
0
    public DataTable GetGLAccountFormatFormSelectByGLAccountFormatId(GLAccountFormatFormUI gLAccountFormatFormUI)
    {
        DataTable dtb = new DataTable();

        dtb = gLAccountFormatFormDAL.GetGLAccountFormatFormSelectByGLAccountFormatId(gLAccountFormatFormUI);
        return(dtb);
    }
Beispiel #2
0
    public DataTable GetGLAccountFormatDetails_SelectBySegmentLenght(GLAccountFormatFormUI gLAccountFormatFormUI)
    {
        DataTable dtb = new DataTable();

        dtb = gLAccountFormatFormDAL.GetGLAccountFormatDetails_SelectBySegmentLenght(gLAccountFormatFormUI);
        return(dtb);
    }
Beispiel #3
0
    public int AddGLAccountFormat(GLAccountFormatFormUI gLAccountFormatFormUI)
    {
        int resutl = 0;

        resutl = gLAccountFormatFormDAL.AddGLAccountFormat(gLAccountFormatFormUI);
        return(resutl);
    }
Beispiel #4
0
    public int DeleteGLAccountFormat(GLAccountFormatFormUI gLAccountFormatFormUI)
    {
        int resutl = 0;

        resutl = gLAccountFormatFormDAL.DeleteGLAccountFormat(gLAccountFormatFormUI);
        return(resutl);
    }
Beispiel #5
0
    private void FillForm(GLAccountFormatFormUI gLAccountFormatFormUI)
    {
        try
        {
            DataTable dtb = gLAccountFormatFormBAL.GetGLAccountFormatListById(gLAccountFormatFormUI);

            if (dtb.Rows.Count > 0)
            {
                txtMaximumAccount.Text         = dtb.Rows[0]["MaximumAccountLength"].ToString();
                txtAccountLength.Text          = dtb.Rows[0]["AccountLength"].ToString();
                txtMaximumSegmentLength.Text   = dtb.Rows[0]["MaximumSegmentLength"].ToString();
                txtSegmentLength.Text          = dtb.Rows[0]["SegmentLength"].ToString();
                ddlMainSegmentId.SelectedValue = dtb.Rows[0]["MainSegment"].ToString();
                txtSeparatedBy.Text            = dtb.Rows[0]["SeparatedBy"].ToString();
                int NoOfRecord = Convert.ToInt32(txtSegmentLength.Text);
                BindAccountFormateDetailsList();
                BindSegmentLenght(NoOfRecord);
            }
            else
            {
                lblError.Text    = Resources.GlobalResource.msgCouldNotLoadData;
                divError.Visible = true;
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "FillForm()";
            logExcpUIobj.ResourceName     = "System_Settings_GLAccountFormatForm.CS";
            logExcpUIobj.RecordId         = gLAccountFormatFormUI.Tbl_GLAccountFormatId;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[System_Settings_GLAccountFormatForm : FillForm] An error occured in the processing of Record Details : [" + exp.ToString() + "]");
        }
    }
Beispiel #6
0
    protected override void Page_Load(object sender, EventArgs e)
    {
        GLAccountFormatFormUI gLAccountFormatFormUI = new GLAccountFormatFormUI();

        if (!Page.IsPostBack)
        {
            if (Request.QueryString["GLAccountFormatId"] != null)
            {
                gLAccountFormatFormUI.Tbl_GLAccountFormatId = Request.QueryString["GLAccountFormatId"];

                BindMainSegmentDropDown();
                BindAccountFormateDetailsList();
                FillForm(gLAccountFormatFormUI);


                //btnSave.Visible = false;
                btnClear.Visible  = false;
                btnUpdate.Visible = true;
                //btnDelete.Visible = true;
                txtMaximumAccount.ReadOnly       = true;
                txtMaximumSegmentLength.ReadOnly = true;
                lblHeading.Text = "Update GLAccountFormat";
            }
            else
            {
                BindMainSegmentDropDown();
                // BindList();
                //btnSave.Visible = true;
                btnClear.Visible  = true;
                btnUpdate.Visible = false;
                //btnDelete.Visible = false;
                lblHeading.Text = "Add New GLAccountFormat";
            }
        }
    }
Beispiel #7
0
    public int UpdateGLAccountFormat(GLAccountFormatFormUI gLAccountFormatFormUI)
    {
        int result = 0;

        try
        {
            using (SqlConnection SupportCon = new SqlConnection(connectionString))
            {
                SupportCon.Open();
                SqlCommand sqlCmd = new SqlCommand("SP_GLAccountFormat_Update", SupportCon);
                sqlCmd.CommandType    = CommandType.StoredProcedure;
                sqlCmd.CommandTimeout = commandTimeout;

                sqlCmd.Parameters.Add("@tbl_GLAccountFormatId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_GLAccountFormatId"].Value = gLAccountFormatFormUI.Tbl_GLAccountFormatId;

                sqlCmd.Parameters.Add("@ModifiedBy", SqlDbType.NVarChar);
                sqlCmd.Parameters["@ModifiedBy"].Value = gLAccountFormatFormUI.ModifiedBy;

                sqlCmd.Parameters.Add("@tbl_OrganizationId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_OrganizationId"].Value = gLAccountFormatFormUI.Tbl_OrganizationId;

                sqlCmd.Parameters.Add("@MaximumAccountLength", SqlDbType.Int);
                sqlCmd.Parameters["@MaximumAccountLength"].Value = gLAccountFormatFormUI.MaximumAccountLength;

                sqlCmd.Parameters.Add("@AccountLength", SqlDbType.Int);
                sqlCmd.Parameters["@AccountLength"].Value = gLAccountFormatFormUI.AccountLength;

                sqlCmd.Parameters.Add("@MaximumSegmentLength", SqlDbType.Int);
                sqlCmd.Parameters["@MaximumSegmentLength"].Value = gLAccountFormatFormUI.MaximumSegmentLength;

                sqlCmd.Parameters.Add("@SegmentLength", SqlDbType.Int);
                sqlCmd.Parameters["@SegmentLength"].Value = gLAccountFormatFormUI.SegmentLength;

                sqlCmd.Parameters.Add("@MainSegment", SqlDbType.Int);
                sqlCmd.Parameters["@MainSegment"].Value = gLAccountFormatFormUI.MainSegment;

                sqlCmd.Parameters.Add("@SeparatedBy", SqlDbType.NVarChar);
                sqlCmd.Parameters["@SeparatedBy"].Value = gLAccountFormatFormUI.SeparatedBy;

                result = sqlCmd.ExecuteNonQuery();

                sqlCmd.Dispose();
                SupportCon.Close();
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "UpdateGLAccountFormat()";
            logExcpUIobj.ResourceName     = "GLAccountFormatFormDAL.CS";
            logExcpUIobj.RecordId         = gLAccountFormatFormUI.Tbl_GLAccountFormatId;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[GLAccountFormatFormDAL : UpdateGLAccountFormat] An error occured in the processing of Record Id : " + gLAccountFormatFormUI.Tbl_GLAccountFormatId + ". Details : [" + exp.ToString() + "]");
        }

        return(result);
    }
Beispiel #8
0
    public DataTable GetGLAccountFormatListById(GLAccountFormatFormUI gLAccountFormatFormUI)
    {
        DataSet   ds   = new DataSet();
        DataTable dtbl = new DataTable();

        try
        {
            using (SqlConnection SupportCon = new SqlConnection(connectionString))
            {
                SqlCommand sqlCmd = new SqlCommand("SP_GLAccountFormat_SelectById", SupportCon);
                sqlCmd.CommandType    = CommandType.StoredProcedure;
                sqlCmd.CommandTimeout = commandTimeout;

                sqlCmd.Parameters.Add("@tbl_GLAccountFormatId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_GLAccountFormatId"].Value = gLAccountFormatFormUI.Tbl_GLAccountFormatId;

                using (SqlDataAdapter adapter = new SqlDataAdapter(sqlCmd))
                {
                    adapter.Fill(ds);
                }
            }
            if (ds.Tables.Count > 0)
            {
                dtbl = ds.Tables[0];
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "getGLAccountFormatListById()";
            logExcpUIobj.ResourceName     = "GLAccountFormatFormDAL.CS";
            logExcpUIobj.RecordId         = gLAccountFormatFormUI.Tbl_GLAccountFormatId;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[GLAccountFormatFormDAL : getGLAccountFormatListById] An error occured in the processing of Record Id : " + gLAccountFormatFormUI.Tbl_GLAccountFormatId + ". Details : [" + exp.ToString() + "]");
        }
        finally
        {
            ds.Dispose();
        }

        return(dtbl);
    }
Beispiel #9
0
    public DataTable GetGLAccountFormatDetails_SelectBySegmentLenght(GLAccountFormatFormUI gLAccountFormatFormUI)
    {
        DataSet   ds   = new DataSet();
        DataTable dtbl = new DataTable();

        //Boolean result = false;
        try
        {
            using (SqlConnection SupportCon = new SqlConnection(connectionString))
            {
                SqlCommand sqlCmd = new SqlCommand("[dbo].[SP_GLAccountFormatDetails_SelectBySegmentLenght]", SupportCon);
                sqlCmd.CommandType    = CommandType.StoredProcedure;
                sqlCmd.CommandTimeout = commandTimeout;

                sqlCmd.Parameters.Add("@SegmentLenght", SqlDbType.Int);
                sqlCmd.Parameters["@SegmentLenght"].Value = gLAccountFormatFormUI.SegmentLength;

                using (SqlDataAdapter adapter = new SqlDataAdapter(sqlCmd))
                {
                    adapter.Fill(ds);
                }
            }
            if (ds.Tables.Count > 0)
            {
                dtbl = ds.Tables[0];
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "GetGLAccountFormatDetails_SelectBySegmentLenght()";
            logExcpUIobj.ResourceName     = "GLAccountFormatFormDAL.CS";
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[GLAccountFormatFormDAL : GetGLAccountFormatDetails_SelectBySegmentLenght] An error occured in the processing of Record Search = " + gLAccountFormatFormUI.Search + " . Details : [" + exp.ToString() + "]");
        }
        finally
        {
            ds.Dispose();
        }

        return(dtbl);
    }