// /////////////////////////////////////////////////////////////////////////////////////////////////////
        //
        // STEP2 - STEPS INFORMATION
        //
        // ////////////////////////////////////////////////////////////////////////
        // STEP2 - STEPS INFORMATION - EVENTS
        //
        protected void grdCosts_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            // Costs Gridview, if the gridview is edition mode
            if (grdCosts.EditIndex >= 0)
            {
                grdCosts.UpdateRow(grdCosts.EditIndex, true);
            }

            // Delete costs
            int serviceId = (int)e.Keys["ServiceID"];
            int refId = (int)e.Keys["RefID"];
            int companyId = Int32.Parse(hdfCompanyId.Value);

            ServiceRequestsManagerToolCostInformation model = new ServiceRequestsManagerToolCostInformation(serviceRequestsManagerToolTDS);
            model.Delete(serviceId, refId);

            // Store dataset
            Session["serviceRequestsManagerToolTDS"] = serviceRequestsManagerToolTDS;
            Session["costInformationManagerTool"] = serviceRequestsManagerToolTDS.CostInformation;

            // Calc TotalCost
            tbxTotalCost.Text = Decimal.Round(model.GetTotalCost(serviceId, companyId), 2).ToString();
        }
        protected void grdCosts_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            Page.Validate("costsDataEdit");
            if (Page.IsValid)
            {
                int serviceId = (int)e.Keys["ServiceID"];
                int refId = (int)e.Keys["RefID"];
                int companyId = Int32.Parse(hdfCompanyId.Value);

                string partNumber = ((TextBox)grdCosts.Rows[e.RowIndex].Cells[2].FindControl("tbxPartNumber")).Text.Trim();
                string partName = ((TextBox)grdCosts.Rows[e.RowIndex].Cells[3].FindControl("tbxPartName")).Text.Trim();
                string vendor = ((TextBox)grdCosts.Rows[e.RowIndex].Cells[4].FindControl("tbxVendor")).Text.Trim();
                decimal cost = decimal.Parse(((TextBox)grdCosts.Rows[e.RowIndex].Cells[5].FindControl("tbxCost")).Text.Trim());

                // Update data
                ServiceRequestsManagerToolCostInformation model = new ServiceRequestsManagerToolCostInformation(serviceRequestsManagerToolTDS);
                model.Update(serviceId, refId, partNumber, partName, vendor, cost);

                // Store dataset
                Session["serviceRequestsManagerToolTDS"] = serviceRequestsManagerToolTDS;
                Session["costInformationManagerTool"] = serviceRequestsManagerToolTDS.CostInformation;

                // Calc TotalCost
                tbxTotalCost.Text = Decimal.Round(model.GetTotalCost(serviceId, companyId), 2).ToString();
            }
            else
            {
                e.Cancel = true;
            }
        }
        private void GrdCostsAdd()
        {
            if (ValidateCostsFooter())
            {
                Page.Validate("costsDataAdd");

                if (Page.IsValid)
                {
                    int serviceId = 1;
                    int companyId = Int32.Parse(hdfCompanyId.Value);
                    string newPartNumber = ((TextBox)grdCosts.FooterRow.FindControl("tbxPartNumberNew")).Text.Trim();
                    string newPartName = ((TextBox)grdCosts.FooterRow.FindControl("tbxPartNameNew")).Text.Trim();
                    string newVendor = ((TextBox)grdCosts.FooterRow.FindControl("tbxVendorNew")).Text.Trim();
                    decimal newCost = Decimal.Round(Decimal.Parse(((TextBox)grdCosts.FooterRow.FindControl("tbxCostNew")).Text.Trim()), 2);

                    ServiceRequestsManagerToolCostInformation model = new ServiceRequestsManagerToolCostInformation(serviceRequestsManagerToolTDS);

                    model.Insert(serviceId, newPartNumber, newPartName, newVendor, newCost, false, companyId);

                    Session.Remove("serviceCostsDummyManagerTool");
                    Session["serviceRequestsManagerToolTDS"] = serviceRequestsManagerToolTDS;
                    Session["costInformationManagerTool"] = serviceRequestsManagerToolTDS.CostInformation;

                    // Calc TotalCost
                    tbxTotalCost.Text = Decimal.Round(model.GetTotalCost(serviceId, companyId), 2).ToString();

                    grdCosts.DataBind();
                    grdCosts.PageIndex = grdCosts.PageCount - 1;
                }
            }
        }