コード例 #1
0
    private void FillForm(GLAccountCurrencyFormUI gLAccountCurrencyFormUI)
    {
        try
        {
            DataTable dtb = gLAccountCurrencyFormBAL.GetGLAccountCurrencyListById(gLAccountCurrencyFormUI);

            if (dtb.Rows.Count > 0)
            {
                txtGLAccountGuid.Text = dtb.Rows[0]["tbl_GLAccountId"].ToString();
                txtGLAccount.Text     = dtb.Rows[0]["tbl_GLAccount"].ToString();
                txtCurrencyGuid.Text  = dtb.Rows[0]["tbl_CurrencyId"].ToString();
                txtCurrency.Text      = dtb.Rows[0]["CurrencyName"].ToString();
            }
            else
            {
                lblError.Text    = Resources.GlobalResource.msgCouldNotLoadData;
                divError.Visible = true;
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "FillForm()";
            logExcpUIobj.ResourceName     = "Finance_General_Ledger_GL_Integration_GLAccountCurrencyForm.CS";
            logExcpUIobj.RecordId         = gLAccountCurrencyFormUI.Tbl_GLAccountCurrencyId;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[Finance_General_Ledger_GL_Integration_GLAccountCurrencyForm : FillForm] An error occured in the processing of Record Details : [" + exp.ToString() + "]");
        }
    }
コード例 #2
0
    protected override void Page_Load(object sender, EventArgs e)
    {
        GLAccountCurrencyFormUI gLAccountCurrencyFormUI = new GLAccountCurrencyFormUI();

        if (!Page.IsPostBack)
        {
            if (Request.QueryString["GLAccountCurrencyId"] != null)
            {
                gLAccountCurrencyFormUI.Tbl_GLAccountCurrencyId = Request.QueryString["GLAccountCurrencyId"];


                FillForm(gLAccountCurrencyFormUI);

                btnSave.Visible   = false;
                btnClear.Visible  = false;
                btnUpdate.Visible = true;
                btnDelete.Visible = true;
                lblHeading.Text   = "Update GLAccountCurrency";
            }
            else
            {
                btnSave.Visible   = true;
                btnClear.Visible  = true;
                btnUpdate.Visible = false;
                btnDelete.Visible = false;
                lblHeading.Text   = "Add New GLAccountCurrency";
            }
        }
    }
コード例 #3
0
    public int DeleteGLAccountCurrency(GLAccountCurrencyFormUI gLAccountCurrencyFormUI)
    {
        int resutl = 0;

        resutl = gLAccountCurrencyFormDAL.DeleteGLAccountCurrency(gLAccountCurrencyFormUI);
        return(resutl);
    }
コード例 #4
0
    public DataTable GetGLAccountCurrencyListById(GLAccountCurrencyFormUI gLAccountCurrencyFormUI)
    {
        DataTable dtb = new DataTable();

        dtb = gLAccountCurrencyFormDAL.GetGLAccountCurrencyListById(gLAccountCurrencyFormUI);
        return(dtb);
    }
コード例 #5
0
    public int UpdateGLAccountCurrency(GLAccountCurrencyFormUI gLAccountCurrencyFormUI)
    {
        int result = 0;

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


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

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

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


                sqlCmd.Parameters.Add("@tbl_GLAccountId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_GLAccountId"].Value = gLAccountCurrencyFormUI.Tbl_GLAccountId;

                sqlCmd.Parameters.Add("@tbl_CurrencyId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_CurrencyId"].Value = gLAccountCurrencyFormUI.Tbl_CurrencyId;

                result = sqlCmd.ExecuteNonQuery();

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

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

        return(result);
    }
コード例 #6
0
    public DataTable GetGLAccountCurrencyListById(GLAccountCurrencyFormUI gLAccountCurrencyFormUI)
    {
        DataSet   ds   = new DataSet();
        DataTable dtbl = new DataTable();

        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 = gLAccountCurrencyFormUI.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     = "GLAccountCurrencyFormDAL.CS";
            logExcpUIobj.RecordId         = gLAccountCurrencyFormUI.Tbl_GLAccountCurrencyId;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

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

        return(dtbl);
    }