private void BindListBySearchParameters(EmployeeGeneralExpensesListUI employeeGeneralExpensesListUI)
    {
        try
        {
            DataTable dtb = employeeGeneralExpensesListBAL.GetEmployeeGeneralExpensesListBySearchParameters(this.employeeGeneralExpensesListUI);


            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_Accounts_Payable_Employee_General_Expenses_EmployeeGeneralExpensesList.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_EmployeeGeneralExpensesList : BindListBySearchParameters] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }
    }
Example #2
0
    private void SearchApplyToDocumentEmployeeGeneralExpensesList()
    {
        try
        {
            EmployeeGeneralExpensesListUI employeeGeneralExpensesListUI = new EmployeeGeneralExpensesListUI();
            employeeGeneralExpensesListUI.Search = txtApplyToDocumentEmployeeGeneralExpensesSearch.Text;


            DataTable dtb = employeeGeneralExpensesListBAL.GetEmployeeGeneralExpensesListBySearchParameters(employeeGeneralExpensesListUI);

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

            log.Error("[Finance_Bank_Accounting_Payment_To_Employees_PaymentToEmployeeApplyForm : SearchApplyToDocumentEmployeeGeneralExpensesList] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }
    }
    public int DeleteEmployeeGeneralExpenses(EmployeeGeneralExpensesListUI employeeGeneralExpensesListUI)
    {
        int result = 0;

        result = employeeGeneralExpensesListDAL.DeleteEmployeeGeneralExpenses(employeeGeneralExpensesListUI);
        return(result);
    }
    public DataTable GetEmployeeGeneralExpensesListBySearchParameters(EmployeeGeneralExpensesListUI employeeGeneralExpensesListUI)
    {
        DataTable dtb = new DataTable();

        dtb = employeeGeneralExpensesListDAL.GetEmployeeGeneralExpensesListBySearchParameters(employeeGeneralExpensesListUI);
        return(dtb);
    }
    public DataTable GetEmployeeGeneralExpensesListById(EmployeeGeneralExpensesListUI employeeGeneralExpensesListUI)
    {
        DataTable dtb = new DataTable();

        dtb = employeeGeneralExpensesListDAL.GetEmployeeGeneralExpensesListById(employeeGeneralExpensesListUI);
        return(dtb);
    }
    public DataTable GetEmployeeGeneralExpensesListById(EmployeeGeneralExpensesListUI employeeGeneralExpensesListUI)
    {
        DataSet   ds   = new DataSet();
        DataTable dtbl = new DataTable();

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

                sqlCmd.Parameters.Add("@tbl_EmployeeAndGroupAccountId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_EmployeeAndGroupAccountId"].Value = employeeGeneralExpensesListUI.Tbl_EmployeeGeneralExpensesId;

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

            log.Error("[EmployeeGeneralExpensesListDAL : GetEmployeeGeneralExpensesListById] An error occured in the processing of Record Id : " + employeeGeneralExpensesListUI.Tbl_EmployeeGeneralExpensesId + ". Details : [" + exp.ToString() + "]");
        }
        finally
        {
            ds.Dispose();
        }

        return(dtbl);
    }
    public int DeleteEmployeeGeneralExpenses(EmployeeGeneralExpensesListUI employeeGeneralExpensesListUI)
    {
        int result = 0;

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

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

                sqlCmd.Parameters.Add("@tbl_EmployeeGeneralExpensesId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_EmployeeGeneralExpensesId"].Value = employeeGeneralExpensesListUI.Tbl_EmployeeGeneralExpensesId;

                result = sqlCmd.ExecuteNonQuery();

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

            log.Error("[EmployeeGeneralExpensesListDAL : DeleteEmployeeGeneralExpenses] An error occured in the processing of Record Id : " + employeeGeneralExpensesListUI.Tbl_EmployeeGeneralExpensesId + ". Details : [" + exp.ToString() + "]");
        }

        return(result);
    }