예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            int hash = 17;

            hash = hash * 23 + Id.GetHashCode();
            hash = hash * 23 + OrgId.GetHashCode();
            hash = hash * 23 + Name.GetHashCode();
            hash = hash * 23 + Role.GetHashCode();

            return(hash);
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            int hash = 17;

            hash = hash * 23 + Id.GetHashCode();
            hash = hash * 23 + OrgId.GetHashCode();
            hash = hash * 23 + Title.GetHashCode();
            hash = hash * 23 + Uid.GetHashCode();
            hash = hash * 23 + HasAcl.GetHashCode();

            return(hash);
        }
예제 #3
0
        protected virtual void AddAuthHeaders()
        {
            if (Client.DefaultRequestHeaders.Contains("Authorization") == false)
            {
                Client.DefaultRequestHeaders.Add("Authorization", "Bearer " + Token);
            }

            if (Client.DefaultRequestHeaders.Contains("orgId") == false)
            {
                Client.DefaultRequestHeaders.Add("orgId", OrgId.ToString());
            }
        }
예제 #4
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            int hash = 17;

            hash = hash * 23 + Id.GetHashCode();
            hash = hash * 23 + OrgId.GetHashCode();
            hash = hash * 23 + IsDefault.GetHashCode();
            hash = hash * 23 + Name.GetHashCode();
            hash = hash * 23 + Type.GetHashCode();
            hash = hash * 23 + Url.GetHashCode();

            return(hash);
        }
예제 #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            if (null == obj)
            {
                return(false);
            }

            if (object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            var d = obj as Dashboard;

            if (null == d)
            {
                return(false);
            }

            if (!Id.Equals(d.Id))
            {
                return(false);
            }

            if (!OrgId.Equals(d.OrgId))
            {
                return(false);
            }

            if (Title != d.Title)
            {
                return(false);
            }

            if (Uid != d.Uid)
            {
                return(false);
            }

            if (!Nullable.Equals(FolderId, d.FolderId))
            {
                return(false);
            }

            if (Data != d.Data)
            {
                return(false);
            }

            return(true);
        }
예제 #6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            if (null == obj)
            {
                return(false);
            }

            if (object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            var u = obj as User;

            if (null == u)
            {
                return(false);
            }

            if (!Id.Equals(u.Id))
            {
                return(false);
            }

            if (!OrgId.Equals(u.OrgId))
            {
                return(false);
            }

            if (Login != u.Login)
            {
                return(false);
            }

            if (Name != u.Name)
            {
                return(false);
            }

            if (Role != u.Role)
            {
                return(false);
            }

            if (Email != u.Email)
            {
                return(false);
            }

            return(true);
        }
예제 #7
0
 public override int GetHashCode()
 {
     unchecked {
         int hashCode = (OrgId != null ? OrgId.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (UserProfile != null ? UserProfile.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (SiteId != null ? SiteId.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (User != null ? User.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (SchemaId != null ? SchemaId.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Mode != null ? Mode.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Platform != null ? Platform.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Environment != null ? Environment.GetHashCode() : 0);
         return(hashCode);
     }
 }
예제 #8
0
 public override int GetHashCode()
 {
     unchecked {
         int hashCode = (OrgId != null ? OrgId.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (SiteId != null ? SiteId.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (User != null ? User.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ApplicationLookupContext != null ? ApplicationLookupContext.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Mode != null ? Mode.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Platform != null ? Platform.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Environment != null ? Environment.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Module != null ? Module.GetHashCode() : 0);
         return(hashCode);
     }
 }
예제 #9
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            int hash = 17;

            hash = hash * 23 + Id.GetHashCode();
            hash = hash * 23 + OrgId.GetHashCode();
            hash = hash * 23 + Name.GetHashCode();
            hash = hash * 23 + Type.GetHashCode();
            hash = hash * 23 + IsDefault.GetHashCode();
            hash = hash * 23 + DisableResolveMessage.GetHashCode();
            hash = hash * 23 + SendReminder.GetHashCode();
            hash = hash * 23 + IncludeImage.GetHashCode();
            hash = hash * 23 + SendOnAllAlerts.GetHashCode();

            return(hash);
        }
예제 #10
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            int hash = 17;

            hash = hash * 23 + Id.GetHashCode();
            hash = hash * 23 + OrgId.GetHashCode();
            hash = hash * 23 + TimeZone.GetHashCode();
            hash = hash * 23 + Theme.GetHashCode();

            if (HomeDashboardId.HasValue)
            {
                hash = hash * 23 + HomeDashboardId.GetHashCode();
            }

            return(hash);
        }
예제 #11
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            int hash = 17;

            hash = hash * 23 + Id.GetHashCode();
            hash = hash * 23 + OrgId.GetHashCode();
            hash = hash * 23 + Title.GetHashCode();
            hash = hash * 23 + Uid.GetHashCode();
            hash = hash * 23 + Data.GetHashCode();

            if (FolderId.HasValue)
            {
                hash = hash * 23 + FolderId.GetHashCode();
            }

            return(hash);
        }
예제 #12
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            if (null == obj)
            {
                return(false);
            }

            if (object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            var u = obj as Folder;

            if (null == u)
            {
                return(false);
            }

            if (!Id.Equals(u.Id))
            {
                return(false);
            }

            if (!OrgId.Equals(u.OrgId))
            {
                return(false);
            }

            if (Title != u.Title)
            {
                return(false);
            }

            if (HasAcl != u.HasAcl)
            {
                return(false);
            }

            if (Uid != u.Uid)
            {
                return(false);
            }

            return(true);
        }
예제 #13
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            if (null == obj)
            {
                return(false);
            }

            if (object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            var p = obj as Preferences;

            if (null == p)
            {
                return(false);
            }

            if (!Id.Equals(p.Id))
            {
                return(false);
            }

            if (!OrgId.Equals(p.OrgId))
            {
                return(false);
            }

            if (!HomeDashboardId.Equals(p.HomeDashboardId))
            {
                return(false);
            }

            if (!TimeZone.Equals(p.TimeZone))
            {
                return(false);
            }

            if (!Theme.Equals(p.Theme))
            {
                return(false);
            }

            return(true);
        }
예제 #14
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            int hash = 17;

            hash = hash * 23 + Id.GetHashCode();
            hash = hash * 23 + OrgId.GetHashCode();
            hash = hash * 23 + DashboardId.GetHashCode();
            hash = hash * 23 + PanelId.GetHashCode();
            hash = hash * 23 + Name.GetHashCode();
            hash = hash * 23 + Message.GetHashCode();
            hash = hash * 23 + State.GetHashCode();
            hash = hash * 23 + Settings.GetHashCode();
            hash = hash * 23 + Frequency.GetHashCode();
            hash = hash * 23 + NewStateDate.GetHashCode();
            hash = hash * 23 + StateChanges.GetHashCode();

            return(hash);
        }
예제 #15
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            int hash = 17;

            hash = hash * 23 + Id.GetHashCode();
            hash = hash * 23 + OrgId.GetHashCode();
            hash = hash * 23 + UserId.GetHashCode();
            hash = hash * 23 + Title.GetHashCode();
            hash = hash * 23 + Text.GetHashCode();
            hash = hash * 23 + DashboardId.GetHashCode();
            hash = hash * 23 + PanelId.GetHashCode();
            hash = hash * 23 + Time.GetHashCode();

            if (null != Alert)
            {
                hash = hash * 23 + Alert.GetHashCode();
            }

            return(hash);
        }
예제 #16
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            if (null == obj)
            {
                return(false);
            }

            if (object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            var u = obj as ApiKey;

            if (null == u)
            {
                return(false);
            }

            if (!Id.Equals(u.Id))
            {
                return(false);
            }

            if (!OrgId.Equals(u.OrgId))
            {
                return(false);
            }

            if (Name != u.Name)
            {
                return(false);
            }

            if (Role != u.Role)
            {
                return(false);
            }

            return(true);
        }
예제 #17
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            if (null == obj)
            {
                return(false);
            }

            if (ReferenceEquals(this, obj))
            {
                return(true);
            }

            var a = obj as Alert;

            if (null == a)
            {
                return(false);
            }

            if (!Id.Equals(a.Id))
            {
                return(false);
            }

            if (!OrgId.Equals(a.OrgId))
            {
                return(false);
            }

            if (!DashboardId.Equals(a.DashboardId))
            {
                return(false);
            }

            if (PanelId != a.PanelId)
            {
                return(false);
            }

            if (Name != a.Name)
            {
                return(false);
            }

            if (Message != a.Message)
            {
                return(false);
            }

            if (Settings != a.Settings)
            {
                return(false);
            }

            if (Frequency != a.Frequency)
            {
                return(false);
            }

            if (NewStateDate != a.NewStateDate)
            {
                return(false);
            }

            if (StateChanges != a.StateChanges)
            {
                return(false);
            }

            return(true);
        }
예제 #18
0
        /// <summary>
        /// Procedure close and sign the work order
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btSave_FormSubmit(object sender, EventArgs e)
        {
            string      sDataGridName;
            DBFieldType FieldType;
            DateTime    daCurrentDate;

            try
            {
                daCurrentDate       = DateTime.Now;
                order               = new clsWorkOrders();
                order.iOrgId        = OrgId;
                order.iId           = OrderId;
                order.iUserId       = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, true);
                order.sInitials     = Signature.sInitials;
                order.sPIN          = Signature.sPIN;
                order.sCleanliness  = tbCleanliness.Text;
                order.daCurrentDate = _functions.CorrectDate(adtClosed.Date);
                if (order.SigningWorkOrderClose() == -1)
                {
                    Signature.sError = _functions.ErrorMessage(140);
                }
                else
                {
                    order.cAction   = "U";
                    order.iNoteId   = 0;
                    order.iItemId   = OrderId;
                    order.daCreated = daCurrentDate;

                    if (tbTechNote.Text.Length > 0)
                    {
                        order.iNoteTypeId = (int)NoteTypes.TechnicianNote;
                        order.sNote       = tbTechNote.Text;
                        order.NoteDetails();
                    }
                    if (tbCheckOutNote.Text.Length > 0)
                    {
                        order.iNoteTypeId = (int)NoteTypes.CheckOutNote;
                        order.sNote       = tbCheckOutNote.Text;
                        order.NoteDetails();
                    }

                    #region saving cutom fields
                    if (ViewState["CustomFields"] != null)
                    {
                        order.iId      = OrderId;
                        dtCustomFields = (DataTable)ViewState["CustomFields"];

                        sDataGridName = repCustomFields.ClientID;

                        // 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:
                                        dtCustomFields.Rows[i]["Value_String"] = Request.Form[sDataGridName + ":_ctl" + j.ToString() + ":ddlValue"];
                                        break;

                                    default:
                                        dtCustomFields.Rows[i]["Value_String"] = Request.Form[sDataGridName + ":_ctl" + j.ToString() + ":tbValue"];
                                        break;
                                    }
                                }
                            }
                        }

                        // saving data to database
                        order.WorkOrderDetail_CustomFields(_functions.SetDataToParameters(dtCustomFields));
                    }
                    #endregion

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

                    finish.sMainText = "The Work Order closed successfully!";

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

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

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

                    finish.bAdditionalVisible = false;

                    finish.bPrintVisible = true;
                    finish.sPrintText    = "[Print the Closed Work Order]";
                    finish.sPrintURL     = "ReportViewer.aspx?Report=FleetProReports%2fCompletedOrder&OrderId=" + OrderId.ToString() + "&OrgId=" + OrgId.ToString();

                    Session["BackFinish"] = finish;

                    Response.Redirect("wo_finish.aspx", false);
                }
            }
            catch (Exception ex)
            {
                _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
                Session["lastpage"]     = "wo_closeWorkOrder.aspx?id=" + OrderId.ToString();
                Session["error"]        = ex.Message;
                Session["error_report"] = ex.ToString();
                Response.Redirect("error.aspx", false);
            }
            finally
            {
                if (order != null)
                {
                    order.Dispose();
                }
            }
        }
예제 #19
0
        private void btNext_FormSubmit(object sender, EventArgs e)
        {
            try
            {
                order               = new clsWorkOrders();
                order.iOrgId        = OrgId;
                order.iId           = OrderId;
                order.sInitials     = Signature.sInitials;
                order.sPIN          = Signature.sPIN;
                order.daCurrentDate = DateTime.Now;
                switch (order.SigningWorkOrderOpen())
                {
                case -1:
                    Signature.sError = _functions.ErrorMessage(140);
                    break;

                case -2:
                    Session["lastpage"] = "wo_preview.aspx?id=" + OrderId.ToString();
                    Session["error"]    = _functions.ErrorMessage(120);
                    Response.Redirect("error.aspx", false);
                    return;

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

                    finish.sMainText = "The Work Order opened successfully!";

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

                    finish.bContinueVisible = false;

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

                    finish.bAdditionalVisible = false;

                    finish.bPrintVisible = true;
                    finish.sPrintText    = "[Print the Opened Work Order]";
                    finish.sPrintURL     = "ReportViewer.aspx?Report=FleetProReports%2fWorkOrderRequest&rs:Command=Render&rc:Parameters=false&OrderId=" + OrderId.ToString() + "&OrgId=" + OrgId.ToString();

                    Session["BackFinish"] = finish;

                    Response.Redirect("wo_finish.aspx", false);
                    break;
                }
            }
            catch (Exception ex)
            {
                _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
                Session["lastpage"]     = "wo_preview.aspx?id=" + OrderId.ToString();
                Session["error"]        = ex.Message;
                Session["error_report"] = ex.ToString();
                Response.Redirect("error.aspx", false);
            }
            finally
            {
                if (order != null)
                {
                    order.Dispose();
                }
            }
        }
        private void Page_Load(object sender, System.EventArgs e)
        {
            string sDomenName, sReportPath;

            try
            {
                OrgId = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, false);

                if (Session["reload"] != null)
                {
                    if ((bool)Session["reload"] == true)
                    {
                        Session["reload"] = null;
                        Response.Redirect((string)Session["RedirectPath"], false);
                        Session["RedirectPath"] = null;
                        return;
                    }
                }

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

                // getting the Bread Crumbs from Cookie and add last item
                if (Request.Cookies.Count > 0 && Request.Cookies["bfp_navigate"] != null)
                {
                    Header.BrdCrumbsSerialization = Request.Cookies["bfp_navigate"].Value;
                }
                Header.AddBreadCrumb("Work Order Detail", "/wo_viewWorkOrder.aspx?id=" + OrderId.ToString());

                SaveCancelControl.ParentPageURL = ParentPageURL;
                SaveCancelControl.EnableSave    = true;
                SaveCancelControl.ButtonText    = " Complete/Sign ";
                SaveCancelControl.CancelText    = " Back ";

                if (!IsPostBack)
                {
                    sReportPath = _functions.GetValueFromConfig("SQLRS.Folder");
                    hlPrintInspectRequest.NavigateUrl   = "ReportViewer.aspx?Report=" + sReportPath + "%2fInspectionRequest&OrgId=" + OrgId.ToString() + "&OrderId=" + OrderId.ToString() + "&InspectId=" + InspectId.ToString();
                    hlPrintCompletedInstect.NavigateUrl = "ReportViewer.aspx?Report=" + sReportPath + "%2fCompletedInspection&OrgId=" + OrgId.ToString() + "&OrderId=" + OrderId.ToString() + "&InspectId=" + InspectId.ToString();

                    user                = new clsUsers();
                    order               = new clsWorkOrders();
                    order.iOrgId        = OrgId;
                    order.iId           = OrderId;
                    order.iInspectionId = InspectId;
                    order.iTechId       = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, true);
                    switch (order.GetInfoForInspection())
                    {
                    case 1:
                        tableMain.Rows[19].Visible   = false;
                        tableMain.Rows[20].Visible   = false;
                        tableMain.Rows[21].Visible   = false;
                        tableMain.Rows[22].Visible   = true;
                        tableMain.Rows[23].Visible   = true;
                        tableMain.Rows[24].Visible   = false;
                        tableMain.Rows[25].Visible   = false;
                        SaveCancelControl.EnableSave = false;

                        order.iDocumentId     = InspectId;
                        order.iDocumentTypeId = (int)DocumentTypes.InspectionCompleted;
                        if (order.GetSignedDocument() != -1)
                        {
                            hlPrintInspectRequest.Enabled   = false;
                            hlPrintCompletedInstect.Enabled = true;
                            lblSign.Text     = order.sUserName.Value;
                            lblSignDate.Text = order.daReportDate.Value.ToShortDateString() + " " + order.daReportDate.Value.ToShortTimeString();
                        }
                        else
                        {
                            hlPrintInspectRequest.Enabled   = true;
                            hlPrintCompletedInstect.Enabled = false;
                            lblSign.Text = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
                        }
                        break;

                    case -1:
                        Session["lastpage"] = "wo_viewWorkOrder.aspx?id=" + OrderId.ToString();
                        Session["error"]    = _functions.ErrorMessage(124);
                        Response.Redirect("error.aspx", false);
                        return;

                    default:
                        hlPrintCompletedInstect.Enabled = false;
                        adtInspection.Date         = DateTime.Now;
                        tableMain.Rows[22].Visible = false;
                        break;
                    }
                    if (!user.IsTechnician(_functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, true)))
                    {
                        SaveCancelControl.EnableSave = false;
                    }
                    ViewState["EquipId"] = order.iEquipId.Value;
                    ViewState["InspectSchedDetailId"] = order.iInspectSchedDetailId.Value;
                    lblInspectName.Text     = order.sInspectionName.Value;
                    lblInspectSchedule.Text = order.sInspectSchedule.Value;
                    lblTargetDaysOut.Text   = order.iInspectTargetDays.Value.ToString() + " days";
                    lblEquipId.Text         = order.sEquipId.Value;
                    lblEquipMake.Text       = order.sEquipMake.Value;
                    lblEquipModel.Text      = order.sEquipModel.Value;

                    repInspectItems.DataSource = new DataView(order.GetWorkOrderInspectItems());
                    repInspectItems.DataBind();
                }
            }
            catch (Exception ex)
            {
                _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
                Session["lastpage"]     = "wo_viewWorkOrder.aspx?id=" + OrderId.ToString();
                Session["error"]        = ex.Message;
                Session["error_report"] = ex.ToString();
                Response.Redirect("error.aspx", false);
            }
            finally
            {
                if (user != null)
                {
                    user.Dispose();
                }
                if (order != null)
                {
                    order.Dispose();
                }
            }
        }
예제 #21
0
        private void SendNoDbEmail(Person goer, GoerSupporter gs)
        {
            var from = new MailAddress(goer.EmailAddress ?? goer.EmailAddress2, goer.Name);
            var db   = DbUtil.Db;

            try
            {
                var text = Body;

                text = text.Replace("{salutation}", gs.Salutation, true);
                text = text.Replace("{track}", "", true);
                var qs   = "OptOut/UnSubscribe/?gid=" + Util.EncryptForUrl($"{gs.Id}");
                var url  = db.ServerLink(qs);
                var link = $@"<a href=""{url}"">Unsubscribe</a>";
                text = text.Replace("{unsubscribe}", link, true);
                text = text.Replace("%7Bfromemail%7D", from.Address, true);
                var supportlink = EmailReplacements.SupportLinkAnonymousReplacement(db, OrgId.ToString(), gs.Id.ToString());
                text = text.Replace("http://supportlink", supportlink, true);
                text = text.Replace("https://supportlink", supportlink, true);
                db.SendEmail(from, Subject, text, Util.ToMailAddressList(gs.NoDbEmail), gs.Id);
            }
            catch (Exception ex)
            {
                db.SendEmail(from, "sent emails - error", ex.ToString(),
                             Util.ToMailAddressList(from), gs.Id);
                throw;
            }
        }
예제 #22
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            if (null == obj)
            {
                return(false);
            }

            if (ReferenceEquals(this, obj))
            {
                return(true);
            }

            var a = obj as AlertNotification;

            if (null == a)
            {
                return(false);
            }

            if (!Id.Equals(a.Id))
            {
                return(false);
            }

            if (!OrgId.Equals(a.OrgId))
            {
                return(false);
            }

            if (Name != a.Name)
            {
                return(false);
            }

            if (Type != a.Type)
            {
                return(false);
            }

            if (IsDefault != a.IsDefault)
            {
                return(false);
            }

            if (DisableResolveMessage != a.DisableResolveMessage)
            {
                return(false);
            }

            if (SendReminder != a.SendReminder)
            {
                return(false);
            }

            if (IncludeImage != a.IncludeImage)
            {
                return(false);
            }

            if (SendOnAllAlerts != a.SendOnAllAlerts)
            {
                return(false);
            }

            return(true);
        }
예제 #23
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                if ((Request.QueryString["equipid"] == null) && (Request.QueryString["orderid"] == null))
                {
                    Session["lastpage"] = "ok_mainMenu.aspx";
                    Session["error"]    = _functions.ErrorMessage(104);
                    Response.Redirect("error.aspx", false);
                    return;
                }
                try
                {
                    OrderId = Convert.ToInt32(Request.QueryString["orderid"]);
                    EquipId = Convert.ToInt32(Request.QueryString["equipid"]);
                }
                catch (FormatException fex)
                {
                    Session["lastpage"] = "ok_mainMenu.aspx";
                    Session["error"]    = _functions.ErrorMessage(105);
                    Response.Redirect("error.aspx", false);
                    return;
                }

                OrgId = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, false);

                NextBackControl.BackText  = "<< Back";
                NextBackControl.BackPage  = "ok_editNote.aspx?orderid=" + OrderId.ToString() + "&equipid=" + EquipId.ToString();
                NextBackControl.NextText  = "  Finish  ";
                NextBackControl.sCSSClass = "ok_input_button";

                op = new OperatorInfo(Request.Cookies["bfp_operator"].Value);

                if (!IsPostBack)
                {
                    lblFirstName.Text = op.FirstName;
                    equip             = new clsEquipment();
                    equip.iOrgId      = OrgId;
                    equip.iId         = EquipId;
                    if (equip.GetEquipInfo() != -1)
                    {
                        lblEquipId.Text   = equip.sEquipId.Value;
                        lblEquipType.Text = equip.sType.Value;
                    }
                    else
                    {
                        Session["lastpage"] = "ok_editNote.aspx?orderid=" + OrderId.ToString() + "&equipid=" + EquipId.ToString();
                        Session["error"]    = _functions.ErrorMessage(102);
                        Response.Redirect("error.aspx", false);
                        return;
                    }
                    order        = new clsWorkOrders();
                    order.iOrgId = OrgId;
                    order.iId    = OrderId;
                    repInstructions.DataSource = new DataView(order.GetInstructionByCheckIn());
                    repInstructions.DataBind();

                    if (order.bPrint.Value)
                    {
                        hlPrint.Visible = true;
                        string Url = Request.Url.AbsoluteUri.Substring(0, Request.Url.AbsoluteUri.LastIndexOf("/")).Replace("/", "%2f");
                        Url = Url.Replace(":", "%3a");
                        hlPrint.Attributes.Add("onclick", "javascript:window.open('ReportViewer.aspx?Report=" + _functions.GetValueFromConfig("SQLRS.Folder") + "%2fCheckInReceipt&OrderId=" + OrderId.ToString() + "&OrgId=" + OrgId.ToString() + "&URL=" + Url + "', 'popupcal', 'toolbars=0');");
                    }
                    else
                    {
                        hlPrint.Visible = false;
                    }
                }
            }
            catch (Exception ex)
            {
                _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
                Session["lastpage"]     = "ok_editNote.aspx?orderid=" + 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();
                }
                if (order != null)
                {
                    order.Dispose();
                }
            }
        }
예제 #24
0
 public override int GetHashCode()
 {
     return(OrgId.GetHashCode());
 }
예제 #25
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            if (null == obj)
            {
                return(false);
            }

            if (ReferenceEquals(this, obj))
            {
                return(true);
            }

            var a = obj as Annotation;

            if (null == a)
            {
                return(false);
            }

            if (!Id.Equals(a.Id))
            {
                return(false);
            }

            if (!OrgId.Equals(a.OrgId))
            {
                return(false);
            }

            if (!UserId.Equals(a.UserId))
            {
                return(false);
            }

            if (Title != a.Title)
            {
                return(false);
            }

            if (Text != a.Text)
            {
                return(false);
            }

            if (DashboardId != a.DashboardId)
            {
                return(false);
            }

            if (PanelId != a.PanelId)
            {
                return(false);
            }

            if (!Nullable.Equals(Time, a.Time))
            {
                return(false);
            }

            if (!Enumerable.SequenceEqual(Tags.OrderBy(x => x), a.Tags.OrderBy(x => x)))
            {
                return(false);
            }

            if (!Nullable.Equals(Alert, a.Alert))
            {
                return(false);
            }

            return(true);
        }