Example #1
0
    public DataTable GetAssetTransferDetailsListById(AssetTransferDetailsFormUI assetTransferDetailsFormUI)
    {
        DataTable dtb = new DataTable();

        dtb = assetTransferDetailsFormDAL.GetAssetTransferDetailsListById(assetTransferDetailsFormUI);
        return(dtb);
    }
Example #2
0
    public int DeleteAssetTransferDetails(AssetTransferDetailsFormUI assetTransferDetailsFormUI)
    {
        int resutl = 0;

        resutl = assetTransferDetailsFormDAL.DeleteAssetTransferDetails(assetTransferDetailsFormUI);
        return(resutl);
    }
Example #3
0
    private void FillForm(AssetTransferDetailsFormUI assetTransferDetailsFormUI)
    {
        try
        {
            DataTable dtb = assetTransferDetailsFormBAL.GetAssetTransferDetailsListById(assetTransferDetailsFormUI);

            if (dtb.Rows.Count > 0)
            {
                txtAssetTransferGuid.Text = dtb.Rows[0]["tbl_AssetTransferId"].ToString();
                txtAssetTransfer.Text     = dtb.Rows[0]["tbl_AssetTransfer"].ToString();
                txtAssetGuid.Text         = dtb.Rows[0]["tbl_AssetId"].ToString();
                txtAsset.Text             = dtb.Rows[0]["tbl_Asset"].ToString();
                txtUOM.Text               = dtb.Rows[0]["UOM"].ToString();
                txtQuantity.Text          = dtb.Rows[0]["Quantity"].ToString();
                txtDescription.Text       = dtb.Rows[0]["Description"].ToString();
                txtLocation_FromGuid.Text = dtb.Rows[0]["tbl_LocationId_From"].ToString();
                txtLocationId_From.Text   = dtb.Rows[0]["tbl_Location_From"].ToString();
                txtLocation_ToGuid.Text   = dtb.Rows[0]["tbl_LocationId_To"].ToString();
                txtLocationId_To.Text     = dtb.Rows[0]["tbl_Location_To"].ToString();
                txtSubTotal.Text          = dtb.Rows[0]["SubTotal"].ToString();
                txtQuantityAvailable.Text = dtb.Rows[0]["QuantityAvailable"].ToString();
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "FillForm()";
            logExcpUIobj.ResourceName     = "Asset_Purchase_AssetTransferDetailsForm.CS";
            logExcpUIobj.RecordId         = this.assetTransferDetailsFormUI.Tbl_AssetTransferDetailsId;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[Asset_Purchase_AssetTransferDetailsForm : FillForm] An error occured in the processing of Record Details : [" + exp.ToString() + "]");
        }
    }
Example #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AssetTransferDetailsFormUI assetTransferDetailsFormUI = new AssetTransferDetailsFormUI();

        if (!Page.IsPostBack)
        {
            if (Request.QueryString["AssetTransferDetailsId"] != null)
            {
                assetTransferDetailsFormUI.Tbl_AssetTransferDetailsId = Request.QueryString["AssetTransferDetailsId"];
                FillForm(assetTransferDetailsFormUI);
                btnSave.Visible   = false;
                btnClear.Visible  = false;
                btnUpdate.Visible = true;
                btnDelete.Visible = true;
                lblHeading.Text   = "Update Asset Transefer Details";
            }
            else
            {
                btnSave.Visible   = true;
                btnClear.Visible  = true;
                btnUpdate.Visible = false;
                btnDelete.Visible = false;
                lblHeading.Text   = "Add New Asset Transfer Details";
            }
        }
    }
Example #5
0
    public DataTable GetAssetTransferDetailsListById(AssetTransferDetailsFormUI assetTransferDetailsFormUI)
    {
        DataSet   ds   = new DataSet();
        DataTable dtbl = new DataTable();

        try
        {
            using (SqlConnection SupportCon = new SqlConnection(connectionString))
            {
                SqlCommand sqlCmd = new SqlCommand("SP_AssetTransferDetails_SelectById", SupportCon);
                sqlCmd.CommandType    = CommandType.StoredProcedure;
                sqlCmd.CommandTimeout = commandTimeout;

                sqlCmd.Parameters.Add("@tbl_AssetTransferDetailsId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_AssetTransferDetailsId"].Value = assetTransferDetailsFormUI.Tbl_AssetTransferDetailsId;

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

            log.Error("[AssetTransferDetailsFormDAL : getAssetTransferDetailsListById] An error occured in the processing of Record Id : " + assetTransferDetailsFormUI.Tbl_AssetTransferDetailsId + ". Details : [" + exp.ToString() + "]");
        }
        finally
        {
            ds.Dispose();
        }

        return(dtbl);
    }
Example #6
0
    public int DeleteAssetTransferDetails(AssetTransferDetailsFormUI assetTransferDetailsFormUI)
    {
        int result = 0;

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

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

                sqlCmd.Parameters.Add("@tbl_AssetTransferDetailsId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_AssetTransferDetailsId"].Value = assetTransferDetailsFormUI.Tbl_AssetTransferDetailsId;

                result = sqlCmd.ExecuteNonQuery();

                sqlCmd.Dispose();
                SupportCon.Close();
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "DeleteAssetTransferDetails()";
            logExcpUIobj.ResourceName     = "AssetTransferDetailsFormDAL.CS";
            logExcpUIobj.RecordId         = assetTransferDetailsFormUI.Tbl_AssetTransferDetailsId;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[AssetTransferDetailsFormDAL : DeleteAssetTransferDetails] An error occured in the processing of Record Id : " + assetTransferDetailsFormUI.Tbl_AssetTransferDetailsId + ". Details : [" + exp.ToString() + "]");
        }

        return(result);
    }
Example #7
0
    public int AddAssetTransferDetails(AssetTransferDetailsFormUI assetTransferDetailsFormUI)
    {
        int result = 0;

        try
        {
            using (SqlConnection SupportCon = new SqlConnection(connectionString))
            {
                SupportCon.Open();
                SqlCommand sqlCmd = new SqlCommand("SP_AssetTransferDetails_Insert", SupportCon);
                sqlCmd.CommandType    = CommandType.StoredProcedure;
                sqlCmd.CommandTimeout = commandTimeout;

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

                sqlCmd.Parameters.Add("@tbl_OrganizationId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_OrganizationId"].Value = assetTransferDetailsFormUI.Tbl_OrganizationId;

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

                sqlCmd.Parameters.Add("@tbl_AssetId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_AssetId"].Value = assetTransferDetailsFormUI.Tbl_AssetId;

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

                sqlCmd.Parameters.Add("@Quantity", SqlDbType.Decimal);
                sqlCmd.Parameters["@Quantity"].Value = assetTransferDetailsFormUI.Quantity;

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

                sqlCmd.Parameters.Add("@tbl_LocationId_From", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_LocationId_From"].Value = assetTransferDetailsFormUI.Tbl_LocationId_From;

                sqlCmd.Parameters.Add("@tbl_LocationId_To", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_LocationId_To"].Value = assetTransferDetailsFormUI.Tbl_LocationId_To;


                sqlCmd.Parameters.Add("@SubTotal", SqlDbType.Decimal);
                sqlCmd.Parameters["@SubTotal"].Value = assetTransferDetailsFormUI.SubTotal;

                sqlCmd.Parameters.Add("@QuantityAvailable", SqlDbType.Int);
                sqlCmd.Parameters["@QuantityAvailable"].Value = assetTransferDetailsFormUI.QuantityAvailable;

                result = sqlCmd.ExecuteNonQuery();

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

            log.Error("[AssetTransferDetailsFormDAL : AddAssetTransferDetails] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }

        return(result);
    }