Example #1
0
        private void btnChangeType_Click(object sender, System.EventArgs e)
        {
            try
            {
                Session["EquipTypeId"] = ddlEquipType.SelectedValue;

                equip = new clsEquipment();

                equip.cAction = "S";
                equip.iOrgId = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, false);
                equip.iTypeId = Convert.ToInt32(ddlEquipType.SelectedValue);

                GenerateCustomFields();
            }
            catch(Exception ex)
            {
                _functions.Log("Application error: \n" + ex.ToString());
                Session["lastpage"] = "addEquip.aspx";
                Session["error"] = ex.Message;
                Session["error_report"] = ex.ToString();
                Response.Redirect("error.aspx", false);
            }
            finally
            {
                if(equip != null)
                {
                    equip.Dispose();
                }
            }
        }
 private void btnReport_Click(object sender, System.EventArgs e)
 {
     try
     {
         equip = new clsEquipment();
         equip.iOrgId = OrgId;
         equip.iId = EquipId;
         equip.daMinDate = adtStartDate.Date;
         equip.daMaxDate = adtEndDate.Date.AddHours(23).AddMinutes(59);
         dgAssignments.DataSource = new DataView(equip.GetEquipmentAssignmentList());
         dgAssignments.DataBind();
         lblEquipId.Text = equip.sEquipId.Value;
     }
     catch(Exception ex)
     {
         _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
         Session["lastpage"] = "e_viewEquipAssignmentReport.aspx?id=" + EquipId.ToString();
         Session["error"] = ex.Message;
         Session["error_report"] = ex.ToString();
         Response.Redirect("error.aspx", false);
     }
     finally
     {
         if(equip != null)
             equip.Dispose();
     }
 }
Example #3
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();
     }
 }
Example #4
0
 private void btSave_FormSubmit(object sender, EventArgs e)
 {
     try
     {
         if(Request.QueryString["id"] == null)
         {
             Session["lastpage"] = "list.aspx";
             Session["error"] = _functions.ErrorMessage(104);
             sURL_return = "error.aspx";
             return;
         }
         try
         {
             EquipId = Convert.ToInt32(Request.QueryString["id"]);
         }
         catch(FormatException fex)
         {
             Session["lastpage"] = "list.aspx";
             Session["error"] = _functions.ErrorMessage(105);
             sURL_return = "error.aspx";
             return;
         }
         equip = new clsEquipment();
         equip.cAction = "U";
         equip.iId = EquipId;
         equip.iOrgId = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, false);
         equip.iModelId = mmValue.ModelId;
         equip.iYear = Convert.ToInt32(tbYear.Text);
         equip.iDeptId = Convert.ToInt32(ddlDepts.SelectedValue);
         equip.iLocId = Convert.ToInt32(ddlLocs.SelectedValue);
         equip.bShare = chShare.Checked;
         equip.sFuelCode = tbFuelCode.Text;
         equip.sEquipId = tbEquipId.Text;
         equip.sVinSerial = tbVinSerial.Text;
         equip.sPlateNumber = tbPlateNumber.Text;
         equip.iUserId = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, true);
         if(equip.EquipmentDetail() == -1)
         {
             Session["lastpage"] = "edit.aspx?id=" + EquipId.ToString();
             Session["error"] = _functions.ErrorMessage(107);
             sURL_return = "error.aspx";
         }
         else
         {
             if(cbReassign.Checked)
             {
                 sURL_return = "reassign.aspx?id=" + EquipId.ToString();
             }
             else
             {
                 sURL_return = "view.aspx?id=" + EquipId.ToString();
             }
         }
     }
     catch(FormatException fex)
     {
         Session["lastpage"] = "edit2.aspx?id=" + EquipId.ToString();
         Session["error"] = _functions.ErrorMessage(108);
         sURL_return = "error.aspx";
     }
     catch(Exception ex)
     {
         _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
         Session["lastpage"] = "edit2.aspx?id=" + EquipId.ToString();
         Session["error"] = ex.Message;
         Session["error_report"] = ex.ToString();
         sURL_return = "error.aspx";
     }
     finally
     {
         if(equip != null)
         {
             equip.Dispose();
         }
     }
     Response.Redirect(sURL_return, true);
 }
        private void btnFiltration_Click(object sender, System.EventArgs e)
        {
            try
            {
                equip = new clsEquipment();

                equip.EnableDefaultFiltration = false;
                equip.iOrgId = OrgId;
                equip.iTypeId = Convert.ToInt32(ddlEquipTypes.SelectedValue);
                equip.iDeptId = Convert.ToInt32(ddlDepartments.SelectedValue);
                equip.iLocId = Convert.ToInt32(ddlLocations.SelectedValue);
                equip.iOrderId = OrderId;
                equip.sEquipId_Filter = _functions.ConvertToSQLFilter(tbEquipId.Text);
                dtMain = equip.GetEquipList_ForSpare();
                ShowList();
            }
            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();
            }
        }
Example #6
0
 private void btSave_FormSubmit(object sender, EventArgs e)
 {
     try
     {
         equip = new clsEquipment();
         equip.iOrgId = OrgId;
         equip.iId = EquipId;
         equip.iUserId = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, true);
         equip.iEquipOperatorId = Convert.ToInt32(ddAssignTo.SelectedValue);
         equip.sNote = tbNote.Text;
         equip.EquipAssignedTo();
         Response.Redirect("e_view.aspx?id="+EquipId.ToString(), false);
     }
     catch(Exception ex)
     {
         _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
         Session["lastpage"] = "e_reassign.aspx?id=" + EquipId.ToString();
         Session["error"] = ex.Message;
         Session["error_report"] = ex.ToString();
         Response.Redirect("error.aspx", false);
     }
     finally
     {
         if(equip!=null)
         {
             equip.Dispose();
         }
     }
 }
        /// <summary>
        /// Activating/Inactivating the user account
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btSave_FormSubmit(object sender, EventArgs e)
        {
            try
            {
                equip = new clsEquipment();
                equip.iUserId = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, true);
                foreach(RepeaterItem _item in repOperatorEquipments.Items)
                {
                    DropDownList ddlOperators = (DropDownList)_item.FindControl("ddlOperators");
                    bool IsNobody = Convert.ToBoolean(ddlOperators.Attributes["IsNobody"]);
                    if(!IsNobody && ddlOperators.SelectedValue == "0")
                    {
                        Header.ErrorMessage = "Operator is required";
                        return;
                    }
                    equip.iOrgId = OrgId;
                    equip.iId = Convert.ToInt32(ddlOperators.Attributes["EquipId"]);
                    equip.iEquipOperatorId = Convert.ToInt32(ddlOperators.SelectedValue);
                    equip.sNote = "Deactivated Operator - Reassigned New Operator";
                    equip.EquipAssignedTo();
                }
                user = new clsUsers();
                user.iOrgId = OrgId;
                user.daCreated = DateTime.Now;
                user.iLoginId = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, true);
                foreach(RepeaterItem _item in repWorkOrders.Items)
                {
                    DropDownList ddlTechs = (DropDownList)_item.FindControl("ddlTechs");
                    bool IsNobody = Convert.ToBoolean(ddlTechs.Attributes["IsNobody"]);
                    if(!IsNobody && ddlTechs.SelectedValue == "0")
                    {
                        Header.ErrorMessage = "Technician is required";
                        return;
                    }
                    user.iOrderId = Convert.ToInt32(ddlTechs.Attributes["OrderId"]);
                    user.iId = Convert.ToInt32(ddlTechs.SelectedValue);
                    user.SetNewTechToWorkOrder();
                }
                user = new clsUsers();
                user.iOrgId = OrgId;
                user.iId = UserId;
                user.bActiveStatus = (bool)ViewState["Active"];
                if(user.UserActive() == -1)
                {
                    Session["lastpage"] = "admin_user_detail_active.aspx?id=" + UserId.ToString();
                    Session["error"] = _functions.ErrorMessage(134);
                    Response.Redirect("error.aspx", false);
                    return;
                }
                if(UserId == _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, true))
                    Response.Redirect("default.aspx", false);
                else
                {
                    // redirect to the finish screen
                    BackFinishScreen finish = new BackFinishScreen();
                    if(((bool)ViewState["Active"]))
                        finish.sMainText = "The user has been activated successfully";
                    else
                        finish.sMainText = "The user has been deactivated successfully";

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

                    finish.bContinueVisible = false;

                    finish.bViewVisible = true;
                    finish.sViewText = "[View the User Detail]";
                    finish.sViewURL = "admin_user_detail.aspx?id=" + UserId.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"] = "admin_user_detail_active.aspx?id=" + UserId.ToString();
                Session["error"] = ex.Message;
                Session["error_report"] = ex.ToString();
                Response.Redirect("error.aspx", false);
            }
            finally
            {
                if(user != null)
                    user.Dispose();
                if(equip != null)
                    equip.Dispose();
            }
        }
Example #8
0
        private void btSave_FormSubmit(object sender, EventArgs e)
        {
            DBFieldType FieldType;
            string sDataGridName;
            try
            {

                if(Request.QueryString["id"] == null)
                {
                    Session["lastpage"] = "list.aspx";
                    Session["error"] = _functions.ErrorMessage(104);
                    Response.Redirect("error.aspx", false);
                    return;
                }
                try
                {
                    EquipId = Convert.ToInt32(Request.QueryString["id"]);
                }
                catch(FormatException fex)
                {
                    Session["lastpage"] = "list.aspx";
                    Session["error"] = _functions.ErrorMessage(105);
                    Response.Redirect("error.aspx", false);
                    return;
                }

                equip = new clsEquipment();
                dtCustomFields = (DataTable)ViewState["CustomFields"];

                equip.cAction = "U";
                equip.iOrgId = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, false);
                equip.iId = EquipId; // editing a Equipment
                equip.iUserId = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, true);
                equip.iTypeId = Convert.ToInt32(ViewState["EquipTypeId"]);

                sDataGridName = "repCustomFields";

                // getting data from Form and changing the dtCustomFields datatable
                for(int i=0; i<dtCustomFields.Rows.Count; i++)
                {
                    for(int j=0; j<Request.Form.Count; j++)
                    {
                        if((string)dtCustomFields.Rows[i]["TypeName"] == Request.Form[sDataGridName + ":_ctl" + j.ToString() + ":inputTypeName"])
                        {
                            FieldType = _functions.TypeNameParser((string)dtCustomFields.Rows[i]["TypeName"]); // nvarchar1...n, ...
                            switch(FieldType)
                            {
                                case DBFieldType._nvarchar:
                                    dtCustomFields.Rows[i]["Value_String"] = Request.Form[sDataGridName + ":_ctl" + j.ToString() + ":tbValue"];
                                    break;
                                case DBFieldType._int:
                                    dtCustomFields.Rows[i]["Value_String"] = Request.Form[sDataGridName + ":_ctl" + j.ToString() + ":tbValue"];
                                    break;
                                case DBFieldType._float:
                                    dtCustomFields.Rows[i]["Value_String"] = Request.Form[sDataGridName + ":_ctl" + j.ToString() + ":tbValue"];
                                    break;
                                case DBFieldType._datetime:
                                    dtCustomFields.Rows[i]["Value_String"] = new SqlDateTime(Convert.ToInt32(Request.Form[sDataGridName + ":_ctl" + j.ToString() + ":adtValue_year"]),
                                        Convert.ToInt32(Request.Form[sDataGridName + ":_ctl" + j.ToString() + ":adtValue_month"]),
                                        Convert.ToInt32(Request.Form[sDataGridName + ":_ctl" + j.ToString() + ":adtValue_day"]));
                                    break;
                                case DBFieldType._bit:
                                    if(Request.Form[sDataGridName + ":_ctl" + j.ToString() + ":chValue"] != null)
                                    {
                                        dtCustomFields.Rows[i]["Value_String"] = "True";
                                    }
                                    else
                                    {
                                        dtCustomFields.Rows[i]["Value_String"] = "False";
                                    }
                                    break;
                                case DBFieldType._ntext:
                                    dtCustomFields.Rows[i]["Value_String"] = Request.Form[sDataGridName + ":_ctl" + j.ToString() + ":tbValue"];
                                    break;
                                case DBFieldType._sql_variant:
                                    dtCustomFields.Rows[i]["Value_String"] = Request.Form[sDataGridName + ":_ctl" + j.ToString() + ":tbValue"];
                                    break;
                                case DBFieldType._lookup:
                                    if((string)dtCustomFields.Rows[i]["ValueName"] != "Make/Model")
                                    {
                                        dtCustomFields.Rows[i]["Value_String"] = Request.Form[sDataGridName + ":_ctl" + j.ToString() + ":ddlValue"];
                                    }
                                    else
                                    {
                                        dtCustomFields.Rows[i]["Value_String"] = Request.Form[sDataGridName + ":_ctl" + j.ToString() + ":mmValue:ddlModels"];
                                    }
                                    break;
                                default:
                                    dtCustomFields.Rows[i]["Value_String"] = Request.Form[sDataGridName + ":_ctl" + j.ToString() + ":tbValue"];
                                    break;
                            }
                        }
                    }
                }

                // saving data to database
                equip.EquipmentDetail_CustomFields(_functions.SetDataToParameters(dtCustomFields));

                if(equip.iId == 0)
                {
                    Response.Redirect("view.aspx?id="+EquipId.ToString(), false);
                }
                else
                {
                    Session["lastpage"] = "editCustom.aspx?id=" + EquipId.ToString();
                    Session["error"] = _functions.ErrorMessage(107);
                    Response.Redirect("error.aspx", false);
                }
            }
            catch(FormatException fex)
            {
                Session["lastpage"] = "editCustom.aspx?id=" + EquipId.ToString();
                Session["error"] = _functions.ErrorMessage(108);
                Response.Redirect("error.aspx", false);
            }
            catch(Exception ex)
            {
                _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
                Session["lastpage"] = "editCustom.aspx?id=" + EquipId.ToString();
                Session["error"] = ex.Message;
                Session["error_report"] = ex.ToString();
                Response.Redirect("error.aspx", false);
            }
            finally
            {
                if(equip!=null)
                {
                    equip.Dispose();
                }
            }
        }
 private void btnFind_Click(object sender, System.EventArgs e)
 {
     try
     {
         equip = new clsEquipment();
         equip.iOrgId = OrgId;
         equip.sEquipId = tbEquipId.Text;
         equip.GetEquipId();
         if(equip.iId.Value == 0)
         {
             lblError.Visible = true;
             tbEquipId.Text = "";
         }
         else
         {
             pnlFindEquipment.Visible = false;
             pnlManyEquipment.Visible = false;
             pnlOneEquipment.Visible = true;
             ViewState["SelectedEqiupId"] = equip.iId.Value.ToString();
             lblEquipId.Text = tbEquipId.Text;
             lblEquipType.Text = equip.sType.Value;
             lblMakeModel.Text = equip.sMakeModelName.Value;
             lblYear.Text = equip.iYear.Value.ToString();
         }
     }
     catch(Exception ex)
     {
         _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
         Session["lastpage"] = "ok_selectEquipment.aspx?orderid=" + OrderId.ToString();
         Session["error"] = ex.Message;
         Session["error_report"] = ex.ToString();
         Response.Redirect("error.aspx", false);
     }
     finally
     {
         if(equip != null)
             equip.Dispose();
     }
 }
Example #10
0
        /// <summary>
        /// Filtration the equipments
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnFiltration_Click(object sender, System.EventArgs e)
        {
            try
            {
                equip = new clsEquipment();

                equip.iOrgId = OrgId;
                equip.iTypeId = Convert.ToInt32(ddlEquipTypes.SelectedValue);
                equip.iDeptId = Convert.ToInt32(ddlDepartments.SelectedValue);
                equip.iLocId = Convert.ToInt32(ddlLocations.SelectedValue);
                equip.iIsSpare = Convert.ToInt32(ddlSpare.SelectedValue);
                equip.iUserId = Convert.ToInt32(ddlDrivers.SelectedValue);
                equip.sEquipId_Filter = _functions.ConvertToSQLFilter(tbEquipId.Text);

                eFilter = new EquipFilter();
                eFilter.iTypeId = equip.iTypeId.Value;
                eFilter.iDeptId = equip.iDeptId.Value;
                eFilter.iIsSpare = equip.iIsSpare.Value;
                eFilter.iLocId = equip.iLocId.Value;
                eFilter.iOperatorId = equip.iUserId.Value;
                eFilter.sEquipId = equip.sEquipId_Filter.Value;
                Session["EquipFilter"] = eFilter;

                switch(sSelect)
                {
                    case "AddOrder":
                        m_bShowUnassigned = false;
                        equip.sLink = "wo_existingWorkOrders.aspx";
                        break;
                    case "AddPastOrder":
                        m_bShowUnassigned = false;
                        equip.sLink = "wo_editAddInfo.aspx";
                        break;
                    case "AddIssue":
                        m_bShowUnassigned = false;
                        equip.sLink = "manageIssues.aspx";
                        break;
                    case "AddRoadside":
                        m_bShowUnassigned = false;
                        equip.sLink = "wo_selectOperator.aspx";
                        break;
                    case "ChangeTempOper":
                        m_bShowUnassigned = true;
                        equip.sLink = "e_selectTempOperator.aspx";
                        break;
                    default:
                        m_bShowUnassigned = false;
                        equip.sLink = "wo_existingWorkOrders.aspx";
                        break;
                }

                //dtEquipments = equip.GetEquipList_Filter(m_bShowUnassigned);
                dtEquipments = equip.GetEquipList_Filter(true);

                if(dtEquipments.Rows.Count > 0)
                {
                    lblError.Visible = false;
                    dgMainList.DataSource = new DataView(dtEquipments);
                    dgMainList.DataBind();
                }
                else
                    lblError.Visible = true;
            }
            catch(Exception ex)
            {
                _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
                Session["lastpage"] = "wo_default.aspx";
                Session["error"] = ex.Message;
                Session["error_report"] = ex.ToString();
                Response.Redirect("error.aspx", false);
            }
            finally
            {
                if(equip != null)
                    equip.Dispose();
            }
        }
        private void btnNO_Click(object sender, System.EventArgs e)
        {
            try
            {
                ViewState["SelectedWorkOrderId"] = null;
                pnlNoneEquipment.Visible = false;
                pnlOneEquipment.Visible = false;
                pnlManyEquipment.Visible = true;

                equip = new clsEquipment();
                equip.iOrgId = OrgId;
                equip.iUserId = 6; //op.Id;

                dtEquipments = equip.GetEquipListForCheckOut();
                repEquipments.DataSource = new DataView(dtEquipments);
                repEquipments.DataBind();
            }
            catch(Exception ex)
            {
                _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
                Session["lastpage"] = "ok_selectWorkOrder.aspx";
                Session["error"] = ex.Message;
                Session["error_report"] = ex.ToString();
                Response.Redirect("error.aspx", false);
            }
            finally
            {
                if(equip != null)
                    equip.Dispose();
            }
        }
        private void btnBackInt_Click(object sender, System.EventArgs e)
        {
            try
            {
                pnlViewQuestion.Visible = true;
                pnlSelectSpare.Visible = false;
                pnlNoSpare.Visible = false;

                lblFirstName.Text = op.FirstName;
                equip = new clsEquipment();
                equip.iOrgId = OrgId;
                equip.iId = EquipId;
                if(equip.GetEquipInfo() != -1)
                    lblEquipType.Text = equip.sType.Value;
                else
                {
                    Session["lastpage"] = CurrentPage;
                    Session["error"] = _functions.ErrorMessage(102);
                    Response.Redirect("error.aspx", false);
                    return;
                }
            }
            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();
            }
        }
        private void btnYES_Click(object sender, System.EventArgs e)
        {
            DataTable dtSpareEquip = null;
            try
            {
                equip = new clsEquipment();
                equip.iOrgId = OrgId;
                equip.iId = EquipId;
                dtSpareEquip = equip.GetSpareEquipList();

                if(dtSpareEquip.Rows.Count > 0)
                { // view spare equipments
                    pnlSelectSpare.Visible = true;
                    pnlNoSpare.Visible = false;
                    pnlViewQuestion.Visible = false;

                    repSpareEquip.DataSource = new DataView(dtSpareEquip);
                    repSpareEquip.DataBind();
                }
                else
                {
                    // no spare
                    pnlNoSpare.Visible = true;
                    pnlSelectSpare.Visible = false;
                    pnlViewQuestion.Visible = false;
                    btnBack.Visible = false;

                    NextBackControl.sCSSClass = "ok_input_button";
                    if(Operation == "CheckIn")
                    {
                        NextBackControl.BackText = "<< Back";
                        NextBackControl.BackPage = BackPage;
                        NextBackControl.NextText = "Continue >>";
                    }
                    else
                    {
                        NextBackControl.NextText = "Back to Main Menu";
                        NextBackControl.BackVisible = 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();
            }
        }
 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();
     }
 }
Example #15
0
 private void btnFind_Click(object sender, System.EventArgs e)
 {
     int EquipId, OrderId;
     DataView dwOrders;
     try
     {
         equip = new clsEquipment();
         equip.iOrgId = OrgId;
         equip.sEquipId = tbEquipmentId.Text;
         if(equip.SearchEquipId() == 0)
         {
             Header.ErrorMessage = "<span style='FONT-SIZE:12pt;'>The specified equipment could not be located</span>";
             tbEquipmentId.Text = "";
         }
         else
         {
             EquipId = equip.iId.Value;
             order = new clsWorkOrders();
             order.iOrgId = OrgId;
             order.daCurrentDate = DateTime.Now;
             dwOrders = new DataView(order.GetActivityWorkOrder());
             dwOrders.RowFilter = "EquipId = " + EquipId.ToString();
             if(dwOrders.Count > 0)
             {
                 dwOrders.Sort = "StatusColor desc, OperatorStatusName asc";
                 OrderId = Convert.ToInt32(dwOrders[0]["Id"].ToString());
                 Response.Redirect("ok_mainDetails.aspx?id=" + OrderId.ToString() + "&back=mainmenu2", false);
             }
             else
                 Response.Redirect("ok_selectEquipment.aspx?orderid=0&equipid=" + EquipId.ToString() + "&back=mainmenu2", false);
         }
     }
     catch(Exception ex)
     {
         _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
         Session["lastpage"] = "ok_mainMenu2.aspx";
         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();
     }
 }
Example #16
0
        private void btSave_FormSubmit(object sender, EventArgs e)
        {
            try
            {
                if(Request.QueryString["id"] == null)
                {
                    Session["lastpage"] = "list.aspx";
                    Session["error"] = _functions.ErrorMessage(104);
                    Response.Redirect("error.aspx", false);
                    return;
                }
                try
                {
                    EquipId=Convert.ToInt32(Request.QueryString["id"]);
                }
                catch(FormatException fex)
                {
                    Session["lastpage"] = "list.aspx";
                    Session["error"] = _functions.ErrorMessage(105);
                    Response.Redirect("error.aspx", false);
                    return;
                }

                equip = new clsEquipment();
                equip.cAction = "S";
                equip.iOrgId = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, false);
                equip.iId = EquipId;
                equip.cAction = "U";
                equip.daDisposed = adtDisposed.Date;
                equip.daOutOfService = adtOutOfService.Date;
                equip.sDispOrgContact = tbOrgContact.Text;
                equip.curDispAmount = Convert.ToDecimal(tbAmount.Text);
                equip.iDispUnits = Convert.ToInt32(tbUnits.Text);
                equip.sDispNotes = tbNotes.Text;
                equip.iDispMethod = Convert.ToInt32(ddMethod.SelectedValue);
                if(equip.EquipmentDetail_Disp() != -1)
                {
                    Response.Redirect("view.aspx?id="+EquipId.ToString(), false);
                }
                else
                {
                    Session["lastpage"] = "editDisp.aspx?id=" + EquipId.ToString();
                    Session["error"] = _functions.ErrorMessage(107);
                    Response.Redirect("error.aspx", false);
                }
            }
            catch(FormatException fex)
            {
                Session["lastpage"] = "editDisp.aspx?id=" + EquipId.ToString();
                Session["error"] = _functions.ErrorMessage(108);
                Response.Redirect("error.aspx", false);
            }
            catch(Exception ex)
            {
                _functions.Log(ex, HttpContext.Current.User.Identity.Name, "editDisp.aspx.cs");
                Session["lastpage"] = "editDisp.aspx?id=" + EquipId.ToString();
                Session["error"] = ex.Message;
                Session["error_report"] = ex.ToString();
                Response.Redirect("error.aspx", false);
            }
            finally
            {
                if(equip != null)
                {
                    equip.Dispose();
                }
            }
        }
Example #17
0
        private void btSave_FormSubmit(object sender, EventArgs e)
        {
            try
            {
                if(Request.QueryString["id"] == null)
                {
                    Session["lastpage"] = "list.aspx";
                    Session["error"] = _functions.ErrorMessage(104);
                    Response.Redirect("error.aspx", false);
                    return;
                }
                try
                {
                    EquipId=Convert.ToInt32(Request.QueryString["id"]);
                }
                catch(FormatException fex)
                {
                    Session["lastpage"] = "list.aspx";
                    Session["error"] = _functions.ErrorMessage(105);
                    Response.Redirect("error.aspx", false);
                    return;
                }

                equip = new clsEquipment();
                equip.cAction = "U";
                equip.iOrgId = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, false);
                equip.iId = EquipId;
                equip.iUserId = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, true);
                equip.iPMSched = Convert.ToInt32(ddPMScheduleId.SelectedValue);
                equip.iInspectId = Convert.ToInt32(ddInspectionId.SelectedValue);
                equip.iCurrentUnits = Convert.ToInt32(tbCurrentUnits.Text);
                if(equip.EquipmentDetail_Alt() == -1)
                {
                    Session["lastpage"] = "edit2.aspx?id=" + EquipId.ToString();
                    Session["error"] = _functions.ErrorMessage(107);
                    Response.Redirect("error.aspx", false);
                    return;
                }
                else
                {
                    Response.Redirect("view.aspx?id="+EquipId.ToString(), false);
                }
            }
            catch(FormatException fex)
            {
                Session["lastpage"] = "edit2.aspx?id=" + EquipId.ToString();
                Session["error"] = _functions.ErrorMessage(108);
                Response.Redirect("error.aspx", false);
            }
            catch(Exception ex)
            {
                _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
                Session["lastpage"] = "edit2.aspx?id=" + EquipId.ToString();
                Session["error"] = ex.Message;
                Session["error_report"] = ex.ToString();
                Response.Redirect("error.aspx", false);
            }
            finally
            {
                if(equip != null)
                {
                    equip.Dispose();
                }
            }
        }
Example #18
0
        private void btSave_FormSubmit(object sender, EventArgs e)
        {
            try
            {
                if(Request.QueryString["id"] == null)
                {
                    Session["lastpage"] = "list.aspx";
                    Session["error"] = _functions.ErrorMessage(104);
                    Response.Redirect("error.aspx", false);
                    return;
                }
                try
                {
                    EquipId=Convert.ToInt32(Request.QueryString["id"]);
                }
                catch(FormatException fex)
                {
                    Session["lastpage"] = "list.aspx";
                    Session["error"] = _functions.ErrorMessage(105);
                    Response.Redirect("error.aspx", false);
                    return;
                }

                equip = new clsEquipment();
                equip.cAction = "S";
                equip.iOrgId = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, false);
                equip.iId = EquipId;
                if(equip.EquipmentDetail() != -1)
                {
                    equip.cAction = "U";
                    equip.daInService = adtInService.Date;
                    equip.daAquired = adtAquired.Date;
                    equip.curPurAmount = Convert.ToDecimal(tbAmount.Text);
                    equip.sPurOrgContact = tbOrgContact.Text;
                    equip.sPurNotes = tbNotes.Text;
                    equip.iPurUnits = Convert.ToInt32(tbUnits.Text);
                    switch(equip.EquipmentDetail())
                    {
                        case -1:
                            Session["lastpage"] = "editAquis.aspx?id=" + EquipId.ToString();
                            Session["error"] = _functions.ErrorMessage(107);
                            Response.Redirect("error.aspx", false);
                            return;
                        case 1:
                            Session["lastpage"] = "editAquis.aspx?id=" + EquipId.ToString();
                            Session["error"] = _functions.ErrorMessage(109);
                            Response.Redirect("error.aspx", false);
                            return;
                        default:
                            Response.Redirect("view.aspx?id="+EquipId+"", false);
                            return;
                    }
                }
                else
                {
                    Session["lastpage"] = "editAquis.aspx?id=" + EquipId.ToString();
                    Session["error"] = _functions.ErrorMessage(102);
                    Response.Redirect("error.aspx", false);
                }
            }
            catch(FormatException fex)
            {
                Session["lastpage"] = "editAquis.aspx?id=" + EquipId.ToString();
                Session["error"] = _functions.ErrorMessage(108);
                Response.Redirect("error.aspx", false);
            }
            catch(Exception ex)
            {
                _functions.Log("Application error: \n" + ex.ToString());
                Session["lastpage"] = "editAquis.aspx?id=" + EquipId.ToString();
                Session["error"] = ex.Message;
                Session["error_report"] = ex.ToString();
                Response.Redirect("error.aspx", false);
            }
            finally
            {
                if(equip != null)
                {
                    equip.Dispose();
                }
            }
        }
Example #19
0
 private void dgUnAssignedIssues_EditCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
 {
     try
     {
         dgUnAssignedIssues.EditItemIndex = e.Item.ItemIndex;
         equip = new clsEquipment();
         equip.iId = EquipId;
         equip.iOrgId = OrgId;
         ShowIssues();
     }
     catch(Exception ex)
     {
         _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
         Session["lastpage"] = sCurrentPage;
         Session["error"] = ex.Message;
         Session["error_report"] = ex.ToString();
         Response.Redirect("error.aspx", false);
     }
     finally
     {
         if(equip != null)
             equip.Dispose();
     }
 }
Example #20
0
        private void btSave_FormSubmit(object sender, EventArgs e)
        {
            try
            {
                equip = new clsEquipment();

                equip.cAction="U";
                equip.iOrgId = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, false);
                equip.iId = 0; // adding a Equipment
                equip.iUserId = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, true);
                equip.iTypeId = Convert.ToInt32(ddlTypes.SelectedValue);
                equip.iModelId = mmValue.ModelId;
                equip.iYear = Convert.ToInt32(tbYear.Text);
                equip.iDeptId = Convert.ToInt32(ddlDepts.SelectedValue);
                equip.iLocId = Convert.ToInt32(ddlLocs.SelectedValue);
                equip.bShare = chShare.Checked;
                equip.sFuelCode = tbFuelCode.Text;
                equip.sEquipId = tbEquipId.Text;
                equip.sVinSerial = tbVinSerial.Text;
                equip.sPlateNumber = tbPlateNumber.Text;
                // saving data to database
                EquipId = equip.EquipmentDetail();
                if(EquipId > 0)
                {
                    sURL_return = "reassign.aspx?id=" + EquipId.ToString();
                }
                else
                {
                    Session["lastpage"] = "addEquip.aspx";
                    Session["error"] = _functions.ErrorMessage(103);
                    sURL_return = "error.aspx";
                }
            }
            catch(FormatException fex)
            {
                Session["lastpage"] = "addEquip.aspx";
                Session["error"] = _functions.ErrorMessage(108);
                sURL_return = "error.aspx";
            }
            catch(Exception ex)
            {
                _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
                Session["lastpage"] = "addEquip.aspx";
                Session["error"] = ex.Message;
                Session["error_report"] = ex.ToString();
                sURL_return = "error.aspx";
            }
            finally
            {
                if(equip!=null)
                {
                    equip.Dispose();
                }
                Response.Redirect(sURL_return, true);
            }
        }
Example #21
0
        private void dgUnAssignedIssues_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
        {
            try
            {
                order = new clsWorkOrders();
                equip = new clsEquipment();
                equip.iId = EquipId;
                equip.iOrgId = OrgId;
                order.cAction = "S";
                order.iOrgId = OrgId;
                order.iReportedIssueId = Convert.ToInt32(((Label)e.Item.FindControl("lblReportIssueId")).Text);
                if(order.WorkOrderReportedIssuesDetail() == -1)
                {
                    Session["lastpage"] = sCurrentPage;
                    Session["error"] = _functions.ErrorMessage(121);
                    Response.Redirect("error.aspx", false);
                    return;
                }
                order.cAction = "U";
                order.sReportDesc = ((TextBox)e.Item.FindControl("tbIssueName")).Text;
                if(order.WorkOrderReportedIssuesDetail() == -1)
                {
                    Session["lastpage"] = sCurrentPage;
                    Session["error"] = _functions.ErrorMessage(121);
                    Response.Redirect("error.aspx", false);
                    return;
                }
                dgUnAssignedIssues.EditItemIndex = -1;

                ShowIssues();
            }
            catch(Exception ex)
            {
                _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
                Session["lastpage"] = sCurrentPage;
                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();
            }
        }
Example #22
0
        /// <summary>
        /// Show the found users by user's filter
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnFiltration_Click(object sender, System.EventArgs e)
        {
            try
            {
                equip = new clsEquipment();

                equip.iOrgId = OrgId;
                equip.iTypeId = Convert.ToInt32(ddlEquipTypes.SelectedValue);
                equip.iDeptId = Convert.ToInt32(ddlDepartments.SelectedValue);
                equip.iLocId = Convert.ToInt32(ddlLocations.SelectedValue);
                equip.iIsSpare = Convert.ToInt32(ddlSpare.SelectedValue);
                equip.iUserId = Convert.ToInt32(ddlDrivers.SelectedValue);
                equip.sEquipId_Filter = _functions.ConvertToSQLFilter(tbEquipId.Text);

                eFilter = new EquipFilter();
                eFilter.iTypeId = equip.iTypeId.Value;
                eFilter.iDeptId = equip.iDeptId.Value;
                eFilter.iLocId = equip.iLocId.Value;
                eFilter.iIsSpare = equip.iIsSpare.Value;
                eFilter.iOperatorId = equip.iUserId.Value;
                eFilter.sEquipId = equip.sEquipId_Filter.Value;
                Session["EquipFilter"] = eFilter;

                ShowList();
            }
            catch(Exception ex)
            {
                _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
                Session["lastpage"] = ParentPageURL;
                Session["error"] = ex.Message;
                Session["error_report"] = ex.ToString();
                Response.Redirect("error.aspx", false);
            }
            finally
            {
                if(equip != null)
                {
                    equip.Dispose();
                }
            }
        }
Example #23
0
        private void btnAddRepair_Click(object sender, System.EventArgs e)
        {
            try
            {
                order = new clsWorkOrders();
                equip = new clsEquipment();
                equip.iId = EquipId;
                equip.iOrgId = OrgId;
                order.cAction = "U";
                order.iOrgId = OrgId;
                order.iEquipId = EquipId;
                order.iReportedIssueId = 0;
                order.iRepairCatId = Convert.ToInt32(ddlCategory.SelectedValue);
                order.sReportDesc = tbDesc.Text;
                order.iId = SqlInt32.Null;
                order.iServiceResultId = SqlInt32.Null;
                order.iServiceCheckId = SqlInt32.Null;
                order.iRepairMultId = SqlInt32.Null;
                if(order.WorkOrderReportedIssuesDetail() == -1)
                {
                    Session["lastpage"] = sCurrentPage;
                    Session["error"] = _functions.ErrorMessage(121);
                    Response.Redirect("error.aspx", false);
                }
                tbDesc.Text = "";
                ddlCategory.SelectedIndex = 0;

                ShowIssues();
            }
            catch(Exception ex)
            {
                _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
                Session["lastpage"] = sCurrentPage;
                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();
            }
        }
Example #24
0
        private void btSave_FormSubmit(object sender, EventArgs e)
        {
            try
            {
                if(Request.QueryString["id"] == null)
                {
                    Session["lastpage"] = "list.aspx";
                    Session["error"] = _functions.ErrorMessage(104);
                    Response.Redirect("error.aspx", false);
                    return;
                }
                try
                {
                    EquipId=Convert.ToInt32(Request.QueryString["id"]);
                }
                catch(FormatException fex)
                {
                    Session["lastpage"] = "list.aspx";
                    Session["error"] = _functions.ErrorMessage(105);
                    Response.Redirect("error.aspx", false);
                    return;
                }

                equip = new clsEquipment();
                equip.cAction = "S";
                equip.iOrgId = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, false);
                equip.iId = EquipId;
                if(equip.EquipmentDetail() != -1)
                {
                    equip.cAction = "U";
                    equip.iStatusId = Convert.ToInt32(ddStatusId.SelectedValue);
                    equip.iPMSched = Convert.ToInt32(ddPMScheduleId.SelectedValue) != 0 ? Convert.ToInt32(ddPMScheduleId.SelectedValue) : SqlInt32.Null;
                    equip.iInspectId = Convert.ToInt32(ddInspectionId.SelectedValue) != 0 ? Convert.ToInt32(ddInspectionId.SelectedValue) : SqlInt32.Null;
                    equip.iCurrentUnits = Convert.ToInt32(tbCurrentUnits.Text);
                    switch(equip.EquipmentDetail())
                    {
                        case -1:
                            Session["lastpage"] = "edit2.aspx?id=" + EquipId.ToString();
                            Session["error"] = _functions.ErrorMessage(107);
                            Response.Redirect("error.aspx", false);
                            return;
                        case 1:
                            Session["lastpage"] = "edit2.aspx?id=" + EquipId.ToString();
                            Session["error"] = _functions.ErrorMessage(109);
                            Response.Redirect("error.aspx", false);
                            return;
                        default:
                            break;
                    }
                }
                else
                {
                    Session["lastpage"] = "edit2.aspx?id=" + EquipId.ToString();
                    Session["error"] = _functions.ErrorMessage(107);
                    Response.Redirect("error.aspx", false);
                    return;
                }
                Response.Redirect("view.aspx?id="+EquipId+"", false);
            }
            catch(FormatException fex)
            {
                Session["lastpage"] = "edit2.aspx?id=" + EquipId.ToString();
                Session["error"] = _functions.ErrorMessage(108);
                Response.Redirect("error.aspx", false);
            }
            catch(Exception ex)
            {
                _functions.Log("Application error: \n" + ex.ToString());
                Session["lastpage"] = "edit2.aspx?id=" + EquipId.ToString();
                Session["error"] = ex.Message;
                Session["error_report"] = ex.ToString();
                Response.Redirect("error.aspx", false);
            }
            finally
            {
                if(equip != null)
                {
                    equip.Dispose();
                }
            }
        }
Example #25
0
 private void btSave_FormSubmit(object sender, EventArgs e)
 {
     try
     {
         equip = new clsEquipment();
         equip.cAction = "U";
         equip.iOrgId = OrgId;
         equip.iId = EquipId;
         equip.daInService = adtInService.Date;
         equip.daAquired = adtAquired.Date;
         equip.curPurAmount = Convert.ToDecimal(tbAmount.Text);
         equip.sPurOrgContact = tbOrgContact.Text;
         equip.sPurNotes = tbNotes.Text;
         equip.dmPurUnits = Convert.ToDecimal(tbUnits.Text);
         if(equip.EquipmentDetail_Aquis() != -1)
         {
             Response.Redirect("e_view.aspx?id=" + EquipId.ToString(), false);
             return;
         }
         else
         {
             Session["lastpage"] = "e_editAquis.aspx?id=" + EquipId.ToString();
             Session["error"] = _functions.ErrorMessage(102);
             Response.Redirect("error.aspx", false);
         }
     }
     catch(FormatException fex)
     {
         Session["lastpage"] = "e_editAquis.aspx?id=" + EquipId.ToString();
         Session["error"] = _functions.ErrorMessage(108);
         Response.Redirect("error.aspx", false);
     }
     catch(Exception ex)
     {
         _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
         Session["lastpage"] = "e_editAquis.aspx?id=" + EquipId.ToString();
         Session["error"] = ex.Message;
         Session["error_report"] = ex.ToString();
         Response.Redirect("error.aspx", false);
     }
     finally
     {
         if(equip != null)
         {
             equip.Dispose();
         }
     }
 }
        private void EquipmentDetails()
        {
            try
            {
                if(OrderId != 0)
                {
                    order = new clsWorkOrders();
                    order.cAction = "S";
                    order.iOrgId = OrgId;
                    order.iId = OrderId;

                    if(order.WorkOrderDetails() == -1)
                    {
                        Session["lastpage"] = "wo_default.aspx?select=AddRoadside";
                        Session["error"] = _functions.ErrorMessage(120);
                        Response.Redirect("error.aspx", false);
                        return;
                    }
                    if(ddlTech.Items.FindByValue(order.iTechId.Value.ToString()) != null)
                        ddlTech.SelectedValue = order.iTechId.Value.ToString();
                    EquipId = order.iEquipId.Value;
                }

                equip = new clsEquipment();
                equip.iOrgId = OrgId;
                equip.iId = EquipId;
                equip.cAction = "S";
                if(equip.EquipmentDetail() == -1)
                {
                    Session["lastpage"] = "wo_default.aspx?select=AddRoadside";
                    Session["error"] = _functions.ErrorMessage(102);
                    Response.Redirect("error.aspx", false);
                    return;
                }
                lblOperator.Text = equip.sEquipOperator.Value;
                lblTempOperator.Text = equip.sTempOperator.Value;
                lblEquipId.Text = equip.sEquipId.Value;
                lblEquipType.Text = equip.sType.Value;
                lblMakeModel.Text = equip.sMakeModelName.Value;
                lblYear.Text = equip.iYear.Value.ToString();
                lblSerial.Text = equip.sVinSerial.Value;
                lblEquipId2.Text = equip.sEquipId.Value;
                lblEquipType2.Text = equip.sType.Value;

            }
            catch(Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            finally
            {
                if(order != null)
                    order.Dispose();
                if(equip != null)
                    equip.Dispose();
            }
        }
Example #27
0
 private void btSave_FormSubmit(object sender, EventArgs e)
 {
     try
     {
         if(Request.QueryString["id"] == null)
         {
             Session["lastpage"] = "list.aspx";
             Session["error"] = _functions.ErrorMessage(104);
             Response.Redirect("error.aspx", false);
             return;
         }
         try
         {
             EquipId=Convert.ToInt32(Request.QueryString["id"]);
         }
         catch(FormatException fex)
         {
             Session["lastpage"] = "list.aspx";
             Session["error"] = _functions.ErrorMessage(105);
             Response.Redirect("error.aspx", false);
             return;
         }
         equip = new clsEquipment();
         equip.iOrgId = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, false);
         equip.iId = EquipId;
         equip.iUserId = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, true);
         equip.iAssignedTo = Convert.ToInt32(ddAssignTo.SelectedValue);
         equip.sNote = tbNote.Text;
         equip.EquipAssignedTo();
         Response.Redirect(ParentPageURL, false);
     }
     catch(Exception ex)
     {
         _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
         Session["lastpage"] = "reassign.aspx?id=" + EquipId.ToString();
         Session["error"] = ex.Message;
         Session["error_report"] = ex.ToString();
         Response.Redirect("error.aspx", false);
     }
     finally
     {
         if(equip!=null)
         {
             equip.Dispose();
         }
     }
 }