Esempio n. 1
0
    private void BindListBySearchParameters(GLAccountCurrencyListUI gLAccountCurrencyListUI)
    {
        try
        {
            DataTable dtb = gLAccountCurrencyListBAL.GetGLAccountCurrencyListBySearchParameters(this.gLAccountCurrencyListUI);


            if (dtb.Rows.Count > 0 && dtb != null)
            {
                gvData.DataSource = dtb;
                gvData.DataBind();
                divError.Visible = false;
                gvData.Visible   = true;
            }
            else
            {
                divError.Visible = true;
                lblError.Text    = Resources.GlobalResource.msgNoRecordFound;
                gvData.Visible   = false;
            }

            txtSearch.Text = "";
            txtSearch.Focus();
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "BindListBySearchParameters()";
            logExcpUIobj.ResourceName     = "Finance_General_Ledger_GL_Integration_GLAccountCurrencyList.CS";
            logExcpUIobj.RecordId         = "All";
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[Finance_General_Ledger_GL_Integration_GLAccountCurrencyList : BindListBySearchParameters] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }
    }
    public int DeleteGLAccountCurrency(GLAccountCurrencyListUI gLAccountCurrencyListUI)
    {
        int result = 0;

        result = gLAccountCurrencyListDAL.DeleteGLAccountCurrency(gLAccountCurrencyListUI);
        return(result);
    }
    public DataTable GetGLAccountCurrencyListBySearchParameters(GLAccountCurrencyListUI gLAccountCurrencyListUI)
    {
        DataTable dtb = new DataTable();

        dtb = gLAccountCurrencyListDAL.GetGLAccountCurrencyListBySearchParameters(gLAccountCurrencyListUI);
        return(dtb);
    }
    public DataTable GetGLAccountCurrencyListById(GLAccountCurrencyListUI gLAccountCurrencyListUI)
    {
        DataTable dtb = new DataTable();

        dtb = gLAccountCurrencyListDAL.GetGLAccountCurrencyListById(gLAccountCurrencyListUI);
        return(dtb);
    }
    public DataTable GetGLAccountCurrencyListById(GLAccountCurrencyListUI gLAccountCurrencyListUI)
    {
        DataSet   ds   = new DataSet();
        DataTable dtbl = new DataTable();

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

                sqlCmd.Parameters.Add("@tbl_GLAccountCurrencyId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_GLAccountCurrencyId"].Value = gLAccountCurrencyListUI.Tbl_GLAccountCurrencyId;

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

            log.Error("[GLAccountCurrencyListDAL : getGLAccountCurrencyListById] An error occured in the processing of Record Id : " + gLAccountCurrencyListUI.Tbl_GLAccountCurrencyId + ". Details : [" + exp.ToString() + "]");
        }
        finally
        {
            ds.Dispose();
        }

        return(dtbl);
    }
    public int DeleteGLAccountCurrency(GLAccountCurrencyListUI gLAccountCurrencyListUI)
    {
        int result = 0;

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

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

                sqlCmd.Parameters.Add("@tbl_GLAccountCurrencyId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_GLAccountCurrencyId"].Value = gLAccountCurrencyListUI.Tbl_GLAccountCurrencyId;

                result = sqlCmd.ExecuteNonQuery();

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

            log.Error("[GLAccountCurrencyListDAL : DeleteGLAccountCurrency] An error occured in the processing of Record Id : " + gLAccountCurrencyListUI.Tbl_GLAccountCurrencyId + ". Details : [" + exp.ToString() + "]");
        }

        return(result);
    }