Пример #1
0
    private void SearchBatchList()
    {
        try
        {
            BatchListUI batchListUI = new BatchListUI();
            batchListUI.Search = txtBatchSearch.Text;


            DataTable dtb = batchListBAL.GetBatchListBySearchParameters(batchListUI);

            if (dtb.Rows.Count > 0 && dtb != null)
            {
                gvBatchSearch.DataSource = dtb;
                gvBatchSearch.DataBind();
                divBatchSearchError.Visible = false;
            }
            else
            {
                divBatchSearchError.Visible = true;
                lblBatchSearchError.Text    = Resources.GlobalResource.msgNoRecordFound;
                gvBatchSearch.Visible       = false;
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "SearchBatchList()";
            logExcpUIobj.ResourceName     = "Finance_Accounts_Payable_Employee_General_Expenses_EmployeeGeneralExpensesForm.CS";
            logExcpUIobj.RecordId         = "All";
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[Finance_Accounts_Payable_Employee_General_Expenses_EmployeeGeneralExpensesForm : SearchBatchList] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }
    }
Пример #2
0
    public int DeleteBatch(BatchListUI batchListUI)
    {
        int result = 0;

        result = batchListDAL.DeleteBatch(batchListUI);
        return(result);
    }
Пример #3
0
    public DataTable GetBatchListBySearchParameters(BatchListUI batchListUI)
    {
        DataTable dtb = new DataTable();

        dtb = batchListDAL.GetBatchListBySearchParameters(batchListUI);
        return(dtb);
    }
Пример #4
0
    public DataTable GetBatchListById(BatchListUI batchListUI)
    {
        DataTable dtb = new DataTable();

        dtb = batchListDAL.GetBatchListById(batchListUI);
        return(dtb);
    }
    private void BindListBySearchParameters(BatchListUI batchListUI)
    {
        try
        {
            DataTable dtb = batchListBAL.GetBatchListBySearchParameters(this.batchListUI);


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

            log.Error("[System_Settings_BatchList : BindListBySearchParameters] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }
    }
Пример #6
0
    public DataTable GetBatchListById(BatchListUI batchListUI)
    {
        DataSet   ds   = new DataSet();
        DataTable dtbl = new DataTable();

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

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

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

            log.Error("[BatchListDAL : getBatchListById] An error occured in the processing of Record Id : " + batchListUI.Tbl_BatchId + ". Details : [" + exp.ToString() + "]");
        }
        finally
        {
            ds.Dispose();
        }

        return(dtbl);
    }
Пример #7
0
    public int DeleteBatch(BatchListUI batchListUI)
    {
        int result = 0;

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

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

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

                result = sqlCmd.ExecuteNonQuery();

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

            log.Error("[BatchListDALqd : DeleteBatch] An error occured in the processing of Record Id : " + batchListUI.Tbl_BatchId + ". Details : [" + exp.ToString() + "]");
        }

        return(result);
    }