private void FillForm(GLAccountBudgetDetailsFormUI gLAccountBudgetDetailsFormUI)
 {
     try
     {
         DataTable dtb = gLAccountBudgetDetailsFormBAL.GetGLAccountBudgetDetailsListById(gLAccountBudgetDetailsFormUI);
         if (dtb.Rows.Count > 0)
         {
             txtGLAccountBudgetGuid.Text = dtb.Rows[0]["tbl_GLAccountBudgetId"].ToString();
             txtGLAccountBudget.Text     = dtb.Rows[0]["GLAccountNumber"].ToString();
             txtFiscalPeriodGuid.Text    = dtb.Rows[0]["tbl_FiscalPeriodId"].ToString();
             txtFiscalPeriod.Text        = dtb.Rows[0]["tbl_FiscalPeriod"].ToString(); //need to change
             txtPeriod.Text     = dtb.Rows[0]["Period"].ToString();
             txtPeriodDate.Text = dtb.Rows[0]["PeriodDate"].ToString();
             txtPeriodName.Text = dtb.Rows[0]["PeriodName"].ToString();
             txtAmount.Text     = dtb.Rows[0]["Amount"].ToString();
         }
         else
         {
             lblError.Text    = Resources.GlobalResource.msgCouldNotLoadData;
             divError.Visible = true;
         }
     }
     catch (Exception exp)
     {
         logExcpUIobj.MethodName       = "FillForm()";
         logExcpUIobj.ResourceName     = "Finance_General_Ledger_GL_Integration_GLAccountBudgetDetailsForm.CS";
         logExcpUIobj.RecordId         = gLAccountBudgetDetailsFormUI.Tbl_GLAccountBudgetDetailsId;
         logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
         logExcpDALobj.SaveExceptionToDB(logExcpUIobj);
         log.Error("[Finance_General_Ledger_GL_Integration_GLAccountBudgetDetailsForm : FillForm] An error occured in the processing of Record Details : [" + exp.ToString() + "]");
     }
 }
    protected override void Page_Load(object sender, EventArgs e)
    {
        GLAccountBudgetDetailsFormUI gLAccountBudgetDetailsFormUI = new GLAccountBudgetDetailsFormUI();

        if (!Page.IsPostBack)
        {
            if (Request.QueryString["GLAccountBudgetDetailsId"] != null)
            {
                gLAccountBudgetDetailsFormUI.Tbl_GLAccountBudgetDetailsId = Request.QueryString["GLAccountBudgetDetailsId"];
                FillForm(gLAccountBudgetDetailsFormUI);
                btnSave.Visible   = false;
                btnClear.Visible  = false;
                btnUpdate.Visible = true;
                btnDelete.Visible = true;
                lblHeading.Text   = "Update GL Account Budget Details";
            }
            else
            {
                btnSave.Visible   = true;
                btnClear.Visible  = true;
                btnUpdate.Visible = false;
                btnDelete.Visible = false;
                lblHeading.Text   = "Add New GL Account Budget Details";
            }
        }
    }
Esempio n. 3
0
    public int DeleteGLAccountBudgetDetails(GLAccountBudgetDetailsFormUI gLAccountBudgetDetailsFormUI)
    {
        int resutl = 0;

        resutl = gLAccountBudgetDetailsFormDAL.DeleteGLAccountBudgetDetails(gLAccountBudgetDetailsFormUI);
        return(resutl);
    }
Esempio n. 4
0
    public DataTable GetGLAccountBudgetDetailsListById(GLAccountBudgetDetailsFormUI gLAccountBudgetDetailsFormUI)
    {
        DataTable dtb = new DataTable();

        dtb = gLAccountBudgetDetailsFormDAL.GetGLAccountBudgetDetailsListById(gLAccountBudgetDetailsFormUI);
        return(dtb);
    }
Esempio n. 5
0
    public int AddGLAccountBudgetDetails(GLAccountBudgetDetailsFormUI gLAccountBudgetDetailsFormUI)
    {
        int result = 0;

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

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

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

                sqlCmd.Parameters.Add("@tbl_GLAccountBudgetId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_GLAccountBudgetId"].Value = gLAccountBudgetDetailsFormUI.Tbl_GLAccountBudgetId;

                sqlCmd.Parameters.Add("@tbl_FiscalPeriodId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_FiscalPeriodId"].Value = gLAccountBudgetDetailsFormUI.Tbl_FiscalPeriodId;

                sqlCmd.Parameters.Add("@Period", SqlDbType.TinyInt);
                sqlCmd.Parameters["@Period"].Value = gLAccountBudgetDetailsFormUI.Period;

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

                sqlCmd.Parameters.Add("@PeriodDate", SqlDbType.DateTime);
                sqlCmd.Parameters["@PeriodDate"].Value = gLAccountBudgetDetailsFormUI.PeriodDate;

                sqlCmd.Parameters.Add("@Amount", SqlDbType.Decimal);
                sqlCmd.Parameters["@Amount"].Value = gLAccountBudgetDetailsFormUI.Amount;

                result = sqlCmd.ExecuteNonQuery();

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

            log.Error("[GLAccountBudgetDetailsFormDAL : AddGLAccountBudgetDetails] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }

        return(result);
    }
Esempio n. 6
0
    public DataTable GetGLAccountBudgetDetailsListById(GLAccountBudgetDetailsFormUI gLAccountBudgetDetailsFormUI)
    {
        DataSet   ds   = new DataSet();
        DataTable dtbl = new DataTable();

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

                sqlCmd.Parameters.Add("@tbl_GLAccountBudgetDetailsId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_GLAccountBudgetDetailsId"].Value = gLAccountBudgetDetailsFormUI.Tbl_GLAccountBudgetDetailsId;

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

            log.Error("[GLAccountBudgetDetailsFormDAL : getGLAccountBudgetDetailsListById] An error occured in the processing of Record Id : " + gLAccountBudgetDetailsFormUI.Tbl_GLAccountBudgetDetailsId + ". Details : [" + exp.ToString() + "]");
        }
        finally
        {
            ds.Dispose();
        }

        return(dtbl);
    }
Esempio n. 7
0
    public int DeleteGLAccountBudgetDetails(GLAccountBudgetDetailsFormUI gLAccountBudgetDetailsFormUI)
    {
        int result = 0;

        try
        {
            using (SqlConnection SupportCon = new SqlConnection(connectionString))
            {
                SupportCon.Open();
                SqlCommand sqlCmd = new SqlCommand("SP_GLAccountBudgetDetails_Delete", SupportCon);

                sqlCmd.CommandType    = CommandType.StoredProcedure;
                sqlCmd.CommandTimeout = commandTimeout;

                sqlCmd.Parameters.Add("@tbl_GLAccountBudgetDetailsId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_GLAccountBudgetDetailsId"].Value = gLAccountBudgetDetailsFormUI.Tbl_GLAccountBudgetDetailsId;

                result = sqlCmd.ExecuteNonQuery();

                sqlCmd.Dispose();
                SupportCon.Close();
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "DeleteGLAccountBudgetDetails()";
            logExcpUIobj.ResourceName     = "GLAccountBudgetDetailsFormDAL.CS";
            logExcpUIobj.RecordId         = gLAccountBudgetDetailsFormUI.Tbl_GLAccountBudgetDetailsId;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[GLAccountBudgetDetailsFormDAL : DeleteGLAccountBudgetDetails] An error occured in the processing of Record Id : " + gLAccountBudgetDetailsFormUI.Tbl_GLAccountBudgetDetailsId + ". Details : [" + exp.ToString() + "]");
        }

        return(result);
    }