Ejemplo n.º 1
0
    private void BindListBySearchParameters(LocationListUI locationListUI)
    {
        try
        {
            DataTable dtb = locationListBAL.GetLocationListBySearchParameters(this.locationListUI);


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

            log.Error("[Location_LocationList : BindListBySearchParameters] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }
    }
    private void SearchLocationList()
    {
        try
        {
            LocationListUI LocationListUI = new LocationListUI();
            LocationListUI.Search = txtLocationSearch.Text;


            DataTable dtb = locationListBAL.GetLocationListBySearchParameters(locationListUI);

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

            log.Error("[Finance_Accounts_Payable_PO_PODetailsForm : SearchLocationList] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }
    }
Ejemplo n.º 3
0
    public int DeleteLocation(LocationListUI locationListUI)
    {
        int result = 0;

        result = locationListDAL.DeleteLocation(locationListUI);
        return(result);
    }
Ejemplo n.º 4
0
    public DataTable GetLocationListBySearchParameters(LocationListUI locationListUI)
    {
        DataTable dtb = new DataTable();

        dtb = locationListDAL.GetLocationListBySearchParameters(locationListUI);
        return(dtb);
    }
Ejemplo n.º 5
0
    public DataTable GetLocationListById(LocationListUI locationListUI)
    {
        DataTable dtb = new DataTable();

        dtb = locationListDAL.GetLocationListById(locationListUI);
        return(dtb);
    }
Ejemplo n.º 6
0
    public DataTable GetLocationListById(LocationListUI locationListUI)
    {
        DataSet   ds   = new DataSet();
        DataTable dtbl = new DataTable();

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

                sqlCmd.Parameters.Add("@tbl_LocationId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_LocationId"].Value = locationListUI.Tbl_LocationId;

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

            log.Error("[LocationListDAL : GetLocationListById] An error occured in the processing of Record Id : " + locationListUI.Tbl_LocationId + ". Details : [" + exp.ToString() + "]");
        }
        finally
        {
            ds.Dispose();
        }

        return(dtbl);
    }
Ejemplo n.º 7
0
    public int DeleteLocation(LocationListUI locationListUI)
    {
        int result = 0;

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

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

                sqlCmd.Parameters.Add("@tbl_LocationId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_LocationId"].Value = locationListUI.Tbl_LocationId;

                result = sqlCmd.ExecuteNonQuery();

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

            log.Error("[LocationListDAL : DeleteLocation] An error occured in the processing of Record Id : " + locationListUI.Tbl_LocationId + ". Details : [" + exp.ToString() + "]");
        }

        return(result);
    }