public int DeleteAssetTransfer(AssetTransferListUI assetTransferListUI)
    {
        int result = 0;

        result = assetTransferListDAL.DeleteAssetTransfer(assetTransferListUI);
        return(result);
    }
Ejemplo n.º 2
0
    private void SearchAssetTransferList()
    {
        try
        {
            AssetTransferListUI assetTransferListUI = new AssetTransferListUI();
            assetTransferListUI.Search = txtAssetTransferSearch.Text;
            DataTable dtb = assetTransferListBAL.GetAssetTransferListBySearchParameters(assetTransferListUI);
            if (dtb.Rows.Count > 0 && dtb != null)
            {
                gvAssetTransferSearch.DataSource = dtb;
                gvAssetTransferSearch.DataBind();
                divAssetTransferSearchError.Visible = false;
                gvAssetTransferSearch.Visible       = true;
            }
            else
            {
                divAssetTransferSearchError.Visible = true;
                lblAssetTransferSearchError.Text    = Resources.GlobalResource.msgNoRecordFound;
                gvAssetTransferSearch.Visible       = false;
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "SearchAssetTransferList()";
            logExcpUIobj.ResourceName     = "Finance_Asset__Accounting_Transfer_of_Assets_AssetTransferDetailsForm.CS";
            logExcpUIobj.RecordId         = "All";
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[Finance_Asset__Accounting_Transfer_of_Assets_AssetTransferDetailsForm : SearchAssetTransferList] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }
    }
    public DataTable GetAssetTransferListBySearchParameters(AssetTransferListUI assetTransferListUI)
    {
        DataTable dtb = new DataTable();

        dtb = assetTransferListDAL.GetAssetTransferListBySearchParameters(assetTransferListUI);
        return(dtb);
    }
    public DataTable GetAssetTransferListById(AssetTransferListUI assetTransferListUI)
    {
        DataTable dtb = new DataTable();

        dtb = assetTransferListDAL.GetAssetTransferListById(assetTransferListUI);
        return(dtb);
    }
    private void BindListBySearchParameters(AssetTransferListUI assetTransferListUI)
    {
        try
        {
            DataTable dtb = assetTransferListBAL.GetAssetTransferListBySearchParameters(this.assetTransferListUI);


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

            log.Error("[Finance_Asset__Accounting_Transfer_of_Assets_AssetTransferList : BindListBySearchParameters] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }
    }
    public DataTable GetAssetTransferListById(AssetTransferListUI assetTransferListUI)
    {
        DataSet   ds   = new DataSet();
        DataTable dtbl = new DataTable();

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

                sqlCmd.Parameters.Add("@tbl_AssetTransferId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_AssetTransferId"].Value = assetTransferListUI.Tbl_AssetTransferId;

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

            log.Error("[AssetTransferListDAL : getAssetTransferListById] An error occured in the processing of Record Id : " + assetTransferListUI.Tbl_AssetTransferId + ". Details : [" + exp.ToString() + "]");
        }
        finally
        {
            ds.Dispose();
        }

        return(dtbl);
    }
    public int DeleteAssetTransfer(AssetTransferListUI assetTransferListUI)
    {
        int result = 0;

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

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

                sqlCmd.Parameters.Add("@tbl_AssetTransferId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_AssetTransferId"].Value = assetTransferListUI.Tbl_AssetTransferId;

                result = sqlCmd.ExecuteNonQuery();

                sqlCmd.Dispose();
                SupportCon.Close();
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "DeleteAssetTransfer()";
            logExcpUIobj.ResourceName     = "AssetTransferListDAL.CS";
            logExcpUIobj.RecordId         = assetTransferListUI.Tbl_AssetTransferId;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[AssetTransferListDAL : DeleteAssetTransfer] An error occured in the processing of Record Id : " + assetTransferListUI.Tbl_AssetTransferId + ". Details : [" + exp.ToString() + "]");
        }

        return(result);
    }