public int DeleteDownPaymentToSupplier(DownPaymentToSupplierListUI downPaymentToSupplierListUI)
    {
        int result = 0;

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

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

                sqlCmd.Parameters.Add("@tbl_DownPaymentToSupplierId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_DownPaymentToSupplierId"].Value = downPaymentToSupplierListUI.Tbl_DownPaymentToSupplierId;

                result = sqlCmd.ExecuteNonQuery();

                sqlCmd.Dispose();
                SupportCon.Close();
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "DeleteDownPaymentToSupplier()";
            logExcpUIobj.ResourceName     = "DownPaymentToSupplierListDAL.CS";
            logExcpUIobj.RecordId         = downPaymentToSupplierListUI.Tbl_DownPaymentToSupplierId;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);
            log.Error("[DownPaymentToSupplierListDAL : DeleteDownPaymentToSupplier] An error occured in the processing of Record Id : " + downPaymentToSupplierListUI.Tbl_DownPaymentToSupplierId + ". Details : [" + exp.ToString() + "]");
        }

        return(result);
    }
Beispiel #2
0
 private void BindListBySearchParameters(DownPaymentToSupplierListUI downPaymentToSupplierListUI)
 {
     try
     {
         DataTable dtb = downPaymentToSupplierListBAL.GetDownPaymentToSupplierListBySearchParameters(this.downPaymentToSupplierListUI);
         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_Bank_Accounting_Down_Payment_Suppliers_DownPaymentToSupplierList.CS";
         logExcpUIobj.RecordId         = "All";
         logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
         logExcpDALobj.SaveExceptionToDB(logExcpUIobj);
         log.Error("[Finance_Bank_Accounting_Down_Payment_Suppliers_DownPaymentToSupplierList : BindListBySearchParameters] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
     }
 }
Beispiel #3
0
    private void SearchDownPaymentToSupplierList()
    {
        try
        {
            DownPaymentToSupplierListUI DownPaymentToSupplierListUI = new DownPaymentToSupplierListUI();
            DownPaymentToSupplierListUI.Search = txtDownPaymentToSupplierSearch.Text;


            DataTable dtb = downPaymentToSupplierListBAL.GetDownPaymentToSupplierListBySearchParameters(DownPaymentToSupplierListUI);

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

            log.Error("[Finance_Bank_Accounting_Down_Payment_Suppliers_DownPaymentToSupplierApplyForm : SearchDownPaymentToSupplierList] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }
    }
    public int DeleteDownPaymentToSupplier(DownPaymentToSupplierListUI downPaymentToSupplierListUI)
    {
        int result = 0;

        result = downPaymentToSupplierListDAL.DeleteDownPaymentToSupplier(downPaymentToSupplierListUI);
        return(result);
    }
    public DataTable GetDownPaymentToSupplierListBySearchParameters(DownPaymentToSupplierListUI downPaymentToSupplierListUI)
    {
        DataTable dtb = new DataTable();

        dtb = downPaymentToSupplierListDAL.GetDownPaymentToSupplierListBySearchParameters(downPaymentToSupplierListUI);
        return(dtb);
    }
    public DataTable GetDownPaymentToSupplierListById(DownPaymentToSupplierListUI downPaymentToSupplierListUI)
    {
        DataTable dtb = new DataTable();

        dtb = downPaymentToSupplierListDAL.GetDownPaymentToSupplierListById(downPaymentToSupplierListUI);
        return(dtb);
    }
    public DataTable GetDownPaymentToSupplierListBySearchParameters(DownPaymentToSupplierListUI downPaymentToSupplierListUI)
    {
        DataSet   ds   = new DataSet();
        DataTable dtbl = new DataTable();

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

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

                using (SqlDataAdapter adapter = new SqlDataAdapter(sqlCmd))
                {
                    adapter.Fill(ds);
                }
            }
            if (ds.Tables.Count > 0)
            {
                dtbl = ds.Tables[0];
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "GetDownPaymentToSupplierListBySearchParameters()";
            logExcpUIobj.ResourceName     = "DownPaymentToSupplierListDAL.CS";
            logExcpUIobj.RecordId         = "Search = " + downPaymentToSupplierListUI.Search;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);
            log.Error("[DownPaymentToSupplierListDAL : GetDownPaymentToSupplierListBySearchParameters] An error occured in the processing of Record Search = " + downPaymentToSupplierListUI.Search + " . Details : [" + exp.ToString() + "]");
        }
        finally
        {
            ds.Dispose();
        }

        return(dtbl);
    }