Exemple #1
0
    public int DeleteChequeBook(ChequeBookListUI chequeBookListUI)
    {
        int result = 0;

        result = chequeBookListDAL.DeleteChequeBook(chequeBookListUI);
        return(result);
    }
Exemple #2
0
    public DataTable GetChequeBookListBySearchParameters(ChequeBookListUI chequeBookListUI)
    {
        DataTable dtb = new DataTable();

        dtb = chequeBookListDAL.GetChequeBookListBySearchParameters(chequeBookListUI);
        return(dtb);
    }
Exemple #3
0
    public DataTable GetChequeBookListById(ChequeBookListUI chequeBookListUI)
    {
        DataTable dtb = new DataTable();

        dtb = chequeBookListDAL.GetChequeBookListById(chequeBookListUI);
        return(dtb);
    }
Exemple #4
0
    private void BindChequeBookListBySearchParameters(ChequeBookListUI chequeBookListUI)
    {
        try
        {
            DataTable dtb = chequeBookListBAL.GetChequeBookListBySearchParameters(chequeBookListUI);

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

            log.Error("[System_Settings_ChequeBookList : BindChequeBookListBySearchParameters] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }
    }
    public DataTable GetChequeBookListBySearchParameters(ChequeBookListUI chequeBookListUI)
    {
        DataSet   ds   = new DataSet();
        DataTable dtbl = new DataTable();

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

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

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

            log.Error("[ChequeBookListDAL : GetChequeBookListBySearchParameters] An error occured in the processing of Record Search = " + chequeBookListUI.Search + " . Details : [" + exp.ToString() + "]");
        }
        finally
        {
            ds.Dispose();
        }

        return(dtbl);
    }
    private void SearchChequeBookList()
    {
        {
            try
            {
                ChequeBookListBAL chequeBookListBAL = new ChequeBookListBAL();
                ChequeBookListUI  chequeBookListUI  = new ChequeBookListUI();


                chequeBookListUI.Search = txtChequeBookSearch.Text;

                DataTable dtb = chequeBookListBAL.GetChequeBookListBySearchParameters(chequeBookListUI);

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

                log.Error("[Finance_Accounts_Receivable_Customer_Master_Creation_CustomerAndGroupAccount : SearchChequeBookList] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
            }
        }
    }
    public int DeleteChequeBook(ChequeBookListUI chequeBookListUI)
    {
        int result = 0;

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

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

                sqlCmd.Parameters.Add("@tbl_ChequeBookId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_ChequeBookId"].Value = chequeBookListUI.Tbl_ChequeBookId;

                result = sqlCmd.ExecuteNonQuery();

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

            log.Error("[ChequeBookListDAL : DeleteChequeBook] An error occured in the processing of Record Id : " + chequeBookListUI.Tbl_ChequeBookId + ". Details : [" + exp.ToString() + "]");
        }

        return(result);
    }