Ejemplo n.º 1
0
 private void btNext_FormSubmit(object sender, EventArgs e)
 {
     try
     {
         equip          = new clsEquipment();
         equip.iOrgId   = OrgId;
         equip.iUserId  = op.Id;
         equip.iOrderId = OrderId;
         equip.iId      = System.Data.SqlTypes.SqlInt32.Null;
         equip.sNote    = "checking in the spare equipment";
         equip.EquipSpareTo(true);
         Response.Redirect("ok_viewNotes.aspx?id=" + OrderId.ToString(), false);
     }
     catch (Exception ex)
     {
         _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
         Session["lastpage"]     = "ok_updateSpare.aspx?id=" + OrderId.ToString();
         Session["error"]        = ex.Message;
         Session["error_report"] = ex.ToString();
         Response.Redirect("error.aspx", false);
     }
     finally
     {
         if (equip != null)
         {
             equip.Dispose();
         }
     }
 }
Ejemplo n.º 2
0
        private void lbCheckInSpare_Click(object sender, System.EventArgs e)
        {
            try
            {
                equip          = new clsEquipment();
                equip.iOrgId   = OrgId;
                equip.iUserId  = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, true);
                equip.iId      = 0;
                equip.iOrderId = OrderId;
                equip.sNote    = "checking in the spare equipment";
                if (equip.EquipSpareTo(false) == -1)
                {
                    Session["lastpage"] = m_sLastPage;
                    Session["error"]    = _functions.ErrorMessage(120);
                    Response.Redirect("error.aspx", false);
                }
                else
                {
                    switch (sBack)
                    {
                    case "open":
                        Response.Redirect("wo_openWorkOrder.aspx?id=" + OrderId.ToString(), false);
                        break;

                    case "edit":
                        Response.Redirect("wo_editWorkOrder.aspx?id=" + OrderId.ToString(), false);
                        break;

                    case "checkin":
                        Response.Redirect("wo_viewCheckIn.aspx?id=" + OrderId.ToString(), false);
                        break;

                    default:
                        Response.Redirect("wo_addRepairs.aspx?id=" + OrderId.ToString(), false);
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
                Session["lastpage"]     = "wo_selectSpareEquip.aspx?id=" + OrderId.ToString() + "&equipid=" + EquipId.ToString();
                Session["error"]        = ex.Message;
                Session["error_report"] = ex.ToString();
                Response.Redirect("error.aspx", false);
            }
            finally
            {
                if (equip != null)
                {
                    equip.Dispose();
                }
            }
        }
Ejemplo n.º 3
0
 private void repSpareEquip_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e)
 {
     try
     {
         if (e.CommandName == "Select")
         {
             // check-out spare eqipment, set NOT staying operator and redirect to Additional Comments screen
             equip          = new clsEquipment();
             equip.iOrgId   = OrgId;
             equip.iUserId  = op.Id;
             equip.iId      = Convert.ToInt32(e.CommandArgument);
             equip.iOrderId = OrderId;
             equip.sNote    = "checking out the spare equipment";
             if (equip.EquipSpareTo(true) == -1)
             {
                 Session["lastpage"] = CurrentPage;
                 Session["error"]    = _functions.ErrorMessage(120);
                 Response.Redirect("error.aspx", false);
             }
             else
             {
                 if (Operation == "CheckIn")
                 {
                     Response.Redirect("ok_editNote.aspx?orderid=" + OrderId.ToString() + "&equipid=" + EquipId.ToString(), false);
                 }
                 else
                 {
                     Response.Redirect(BackPage, false);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
         Session["lastpage"]     = CurrentPage;
         Session["error"]        = ex.Message;
         Session["error_report"] = ex.ToString();
         Response.Redirect("error.aspx", false);
     }
     finally
     {
         if (equip != null)
         {
             equip.Dispose();
         }
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Procedure close the work order detail
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btSave_FormSubmit(object sender, EventArgs e)
        {
            DateTime daCurrentDate;

            try
            {
                daCurrentDate       = DateTime.Now;
                order               = new clsWorkOrders();
                order.iOrgId        = OrgId;
                order.iId           = OrderId;
                order.sInitials     = Signature.sInitials;
                order.sPIN          = Signature.sPIN;
                order.sReleasedTo   = tbReleasedTo.Text;
                order.daCurrentDate = _functions.CorrectDate(adtCheckOut.Date);
                // signing the Check-Out of Equipment by Technician
                if (order.SigningEquipmentCheckOut() == -1)
                {
                    Signature.sError = _functions.ErrorMessage(140);
                }
                else
                {
                    equip          = new clsEquipment();
                    equip.iOrgId   = OrgId;
                    equip.iUserId  = order.iUserId;
                    equip.iOrderId = OrderId;
                    equip.iId      = System.Data.SqlTypes.SqlInt32.Null;
                    equip.sNote    = "";
                    equip.EquipSpareTo(false);

                    // redirect to the finish screen
                    BackFinishScreen finish = new BackFinishScreen();

                    finish.sMainText = "The Equipment has been checked-out successfully!";

                    finish.bMainMenuVisible = true;
                    finish.sMainMenuText    = "[Return to Main Menu]";
                    finish.sMainMenuURL     = "main.aspx";

                    finish.bContinueVisible = false;

                    finish.bViewVisible = true;
                    finish.sViewText    = "[Return to Work Order Detail]";
                    finish.sViewURL     = "wo_viewWorkOrder.aspx?id=" + OrderId.ToString();

                    finish.bAdditionalVisible = false;

                    finish.bPrintVisible = false;

                    Session["BackFinish"] = finish;

                    Response.Redirect("wo_finish.aspx", false);
                }
            }
            catch (Exception ex)
            {
                _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
                Session["lastpage"]     = "wo_viewCheckOut.aspx?id=" + OrderId.ToString();
                Session["error"]        = ex.Message;
                Session["error_report"] = ex.ToString();
                Response.Redirect("error.aspx", false);
            }
            finally
            {
                if (equip != null)
                {
                    equip.Dispose();
                }
                if (order != null)
                {
                    order.Dispose();
                }
            }
        }
Ejemplo n.º 5
0
        private void dgMainList_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
        {
            try
            {
                if (e.CommandName == "Select")
                {
                    SpareId = Convert.ToInt32(e.CommandArgument);

                    equip          = new clsEquipment();
                    equip.iOrgId   = OrgId;
                    equip.iUserId  = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, true);
                    equip.iId      = SpareId;
                    equip.iOrderId = OrderId;
                    equip.sNote    = "checking out the spare equipment";
                    if (equip.EquipSpareTo(false) == -1)
                    {
                        Session["lastpage"] = m_sLastPage;
                        Session["error"]    = _functions.ErrorMessage(120);
                        Response.Redirect("error.aspx", false);
                    }
                    else
                    {
                        if (ViewState["Operation"] == null)
                        {
                            switch (sBack)
                            {
                            case "open":
                                Response.Redirect("wo_openWorkOrder.aspx?id=" + OrderId.ToString(), false);
                                break;

                            case "edit":
                                Response.Redirect("wo_editWorkOrder.aspx?id=" + OrderId.ToString(), false);
                                break;

                            case "checkin":
                                Response.Redirect("wo_viewCheckIn.aspx?id=" + OrderId.ToString(), false);
                                break;

                            default:
                                Response.Redirect("wo_addRepairs.aspx?id=" + OrderId.ToString(), false);
                                break;
                            }
                        }
                        else
                        {
                            BackFinishScreen finish = new BackFinishScreen();
                            finish.sMainText = "The Roadside Repair Work Order has been created successfully!";

                            finish.bMainMenuVisible = true;
                            finish.sMainMenuText    = "[Return to Main Menu]";
                            finish.sMainMenuURL     = "main.aspx";

                            finish.bContinueVisible = true;
                            finish.sContinueText    = "[Continue to Check-In Equipment by Technician]";
                            finish.sContinueURL     = "wo_viewCheckIn.aspx?id=" + OrderId.ToString();

                            finish.bViewVisible = true;
                            finish.sViewText    = "[View the Scheduled Work Order]";
                            finish.sViewURL     = "wo_viewWorkOrder.aspx?id=" + OrderId.ToString();

                            finish.bAdditionalVisible = true;
                            finish.sAdditionalText    = "[Create a New Work Order]";
                            finish.sAdditionalURL     = "wo_default.aspx?select=AddRoadside";

                            finish.bPrintVisible = false;

                            Session["BackFinish"] = finish;

                            Response.Redirect("wo_finish.aspx", false);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
                Session["lastpage"]     = "wo_selectSpareEquip.aspx?id=" + OrderId.ToString() + "&equipid=" + EquipId.ToString();
                Session["error"]        = ex.Message;
                Session["error_report"] = ex.ToString();
                Response.Redirect("error.aspx", false);
            }
            finally
            {
                if (equip != null)
                {
                    equip.Dispose();
                }
            }
        }