public int DeleteGLAccountEntry(GLAccountEntryFormUI gLAccountEntryFormUI)
    {
        int resutl = 0;

        resutl = gLAccountEntryFormDAL.DeleteGLAccountEntry(gLAccountEntryFormUI);
        return(resutl);
    }
    public DataTable GetGLAccountEntryListById(GLAccountEntryFormUI gLAccountEntryFormUI)
    {
        DataTable dtb = new DataTable();

        dtb = gLAccountEntryFormDAL.GetGLAccountEntryListById(gLAccountEntryFormUI);
        return(dtb);
    }
    public int AddGLAccountEntry(GLAccountEntryFormUI gLAccountEntryFormUI)
    {
        int resutl = 0;

        resutl = gLAccountEntryFormDAL.AddGLAccountEntry(gLAccountEntryFormUI);
        return(resutl);
    }
    protected override void Page_Load(object sender, EventArgs e)
    {
        GLAccountEntryFormUI gLAccountEntryFormUI = new GLAccountEntryFormUI();

        if (!Page.IsPostBack)
        {
            if (Request.QueryString["GLAccountEntryId"] != null)
            {
                gLAccountEntryFormUI.Tbl_GLAccountEntryId = Request.QueryString["GLAccountEntryId"];

                FillForm(gLAccountEntryFormUI);

                btnSave.Visible   = false;
                btnClear.Visible  = false;
                btnUpdate.Visible = true;
                btnDelete.Visible = true;
                lblHeading.Text   = "Update GLAccountEntry";
            }
            else
            {
                btnSave.Visible   = true;
                btnClear.Visible  = true;
                btnUpdate.Visible = false;
                btnDelete.Visible = false;
                lblHeading.Text   = "Add New GLAccountEntry";
            }
        }
    }
    private void FillForm(GLAccountEntryFormUI gLAccountEntryFormUI)
    {
        try
        {
            DataTable dtb = gLAccountEntryFormBAL.GetGLAccountEntryListById(gLAccountEntryFormUI);

            if (dtb.Rows.Count > 0)
            {
                txtJournal.Text   = dtb.Rows[0]["JournalEntry"].ToString();
                txtBatchGuid.Text = dtb.Rows[0]["Tbl_BatchId"].ToString();
                txtBatch.Text     = dtb.Rows[0]["BatchName"].ToString();
                if (Convert.ToBoolean(dtb.Rows[0]["TransactionType"]) == true)
                {
                    chkTransactionType.Checked = true;
                }
                else
                {
                    chkTransactionType.Checked = false;
                }


                if (DateTime.TryParseExact(txtTransactionDate.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture,
                                           DateTimeStyles.None, out date))
                {
                    txtTransactionDate.Text = dtb.Rows[0]["TransactionDate"].ToString();
                }
                txtSourceDocument.Text     = dtb.Rows[0]["SourceDocumentName"].ToString();
                txtSourceDocumentGuid.Text = dtb.Rows[0]["Tbl_SourceDocument"].ToString();
                txtReference.Text          = dtb.Rows[0]["Reference"].ToString();
                txtCurrency.Text           = dtb.Rows[0]["CurrencyName"].ToString();
                txtCurrencyGuid.Text       = dtb.Rows[0]["Tbl_CurrencyId"].ToString();
            }
            else
            {
                lblError.Text    = Resources.GlobalResource.msgCouldNotLoadData;
                divError.Visible = true;
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "FillForm()";
            logExcpUIobj.ResourceName     = "System_Settings_GLAccountEntryForm.CS";
            logExcpUIobj.RecordId         = gLAccountEntryFormUI.Tbl_GLAccountEntryId;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[System_Settings_GLAccountEntryForm : FillForm] An error occured in the processing of Record Details : [" + exp.ToString() + "]");
        }
    }
Exemplo n.º 6
0
    public DataTable GetGLAccountEntryListById(GLAccountEntryFormUI gLAccountEntryFormUI)
    {
        DataSet   ds   = new DataSet();
        DataTable dtbl = new DataTable();

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

                sqlCmd.Parameters.Add("@tbl_GLAccountEntryId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_GLAccountEntryId"].Value = gLAccountEntryFormUI.Tbl_GLAccountEntryId;

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

            log.Error("[GLAccountEntryFormDAL : getGLAccountEntryListById] An error occured in the processing of Record Id : " + gLAccountEntryFormUI.Tbl_GLAccountEntryId + ". Details : [" + exp.ToString() + "]");
        }
        finally
        {
            ds.Dispose();
        }

        return(dtbl);
    }
Exemplo n.º 7
0
    public int DeleteGLAccountEntry(GLAccountEntryFormUI gLAccountEntryFormUI)
    {
        int result = 0;

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

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

                sqlCmd.Parameters.Add("@tbl_GLAccountEntryId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_GLAccountEntryId"].Value = gLAccountEntryFormUI.Tbl_GLAccountEntryId;

                result = sqlCmd.ExecuteNonQuery();

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

            log.Error("[GLAccountEntryFormDAL : DeleteGLAccountEntry] An error occured in the processing of Record Id : " + gLAccountEntryFormUI.Tbl_GLAccountEntryId + ". Details : [" + exp.ToString() + "]");
        }

        return(result);
    }
Exemplo n.º 8
0
    public int AddGLAccountEntry(GLAccountEntryFormUI gLAccountEntryFormUI)
    {
        int result = 0;

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

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

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

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

                sqlCmd.Parameters.Add("@tbl_BatchId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_BatchId"].Value = gLAccountEntryFormUI.Tbl_BatchId;

                sqlCmd.Parameters.Add("@TransactionType", SqlDbType.Bit);
                sqlCmd.Parameters["@TransactionType"].Value = gLAccountEntryFormUI.TransactionType;

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

                //sqlCmd.Parameters.Add("@TransactionDate_Hijri", SqlDbType.BigInt);
                //sqlCmd.Parameters["@TransactionDate_Hijri"].Value = gLAccountEntryFormUI.TransactionDate_Hijri;

                sqlCmd.Parameters.Add("@tbl_SourceDocument", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_SourceDocument"].Value = gLAccountEntryFormUI.Tbl_SourceDocument;

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

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

                result = sqlCmd.ExecuteNonQuery();

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

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

        return(result);
    }