コード例 #1
0
    public int DeletePhysicalLocation(PhysicalLocationListUI physicalLocationListUI)
    {
        int result = 0;

        result = physicalLocationListDAL.DeletePhysicalLocation(physicalLocationListUI);
        return(result);
    }
コード例 #2
0
    private void SearchPhysicalLocationList()
    {
        try
        {
            PhysicalLocationListUI physicalLocationListUI = new PhysicalLocationListUI();
            physicalLocationListUI.Search = txtPhysicalLocationSearch.Text;
            DataTable dtb = physicalLocationListBAL.GetPhysicalLocationListBySearchParameters(physicalLocationListUI);
            if (dtb.Rows.Count > 0 && dtb != null)
            {
                gvPhysicalLocationSearch.DataSource = dtb;
                gvPhysicalLocationSearch.DataBind();
                divPhysicalLocationSearchError.Visible = false;
            }
            else
            {
                divPhysicalLocationSearchError.Visible = true;
                lblPhysicalLocationSearchError.Text    = Resources.GlobalResource.msgNoRecordFound;
                gvPhysicalLocationSearch.Visible       = false;
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "SearchPhysicalLocationList()";
            logExcpUIobj.ResourceName     = "Assets_Asset_AssetForm.CS";
            logExcpUIobj.RecordId         = "All";
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[Assets_Asset_AssetForm : SearchPhysicalLocationList] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }
    }
コード例 #3
0
    public DataTable GetPhysicalLocationListBySearchParameters(PhysicalLocationListUI physicalLocationListUI)
    {
        DataTable dtb = new DataTable();

        dtb = physicalLocationListDAL.GetPhysicalLocationListBySearchParameters(physicalLocationListUI);
        return(dtb);
    }
コード例 #4
0
    public DataTable GetPhysicalLocationListById(PhysicalLocationListUI PhysicalLocationListUI)
    {
        DataTable dtb = new DataTable();

        dtb = physicalLocationListDAL.GetPhysicalLocationListById(PhysicalLocationListUI);
        return(dtb);
    }
コード例 #5
0
    private void BindListBySearchParameters(PhysicalLocationListUI physicalLocationListUI)
    {
        try
        {
            DataTable dtb = physicalLocationListBAL.GetPhysicalLocationListBySearchParameters(this.physicalLocationListUI);


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

            log.Error("[PhysicalLocation_PhysicalLocationList : BindListBySearchParameters] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }
    }
コード例 #6
0
    public DataTable GetPhysicalLocationListById(PhysicalLocationListUI physicalLocationListUI)
    {
        DataSet   ds   = new DataSet();
        DataTable dtbl = new DataTable();

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

                sqlCmd.Parameters.Add("@tbl_PhysicalLocationId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_PhysicalLocationId"].Value = physicalLocationListUI.Tbl_PhysicalLocationId;

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

            log.Error("[PhysicalLocationListDAL : GetPhysicalLocationListById] An error occured in the processing of Record Id : " + physicalLocationListUI.Tbl_PhysicalLocationId + ". Details : [" + exp.ToString() + "]");
        }
        finally
        {
            ds.Dispose();
        }

        return(dtbl);
    }
コード例 #7
0
    public int DeletePhysicalLocation(PhysicalLocationListUI physicalLocationListUI)
    {
        int result = 0;

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

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

                sqlCmd.Parameters.Add("@tbl_PhysicalLocationId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_PhysicalLocationId"].Value = physicalLocationListUI.Tbl_PhysicalLocationId;

                result = sqlCmd.ExecuteNonQuery();

                sqlCmd.Dispose();
                SupportCon.Close();
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "DeletePhysicalLocation()";
            logExcpUIobj.ResourceName     = "PhysicalLocationListDAL.CS";
            logExcpUIobj.RecordId         = physicalLocationListUI.Tbl_PhysicalLocationId;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[PhysicalLocationListDAL : DeletePhysicalLocation] An error occured in the processing of Record Id : " + physicalLocationListUI.Tbl_PhysicalLocationId + ". Details : [" + exp.ToString() + "]");
        }

        return(result);
    }