Beispiel #1
0
        public static UpdateDate FindUpdateDate(DateTime startDate, DateTime endDate)
        {
            var returnDate = new UpdateDate();

            if (startDate == default)
            {
                return(new UpdateDate
                {
                    Day = 0,
                    Month = 0,
                    Year = 0
                });
            }

            if (endDate == default)
            {
                returnDate.Day   = startDate.Day;
                returnDate.Month = startDate.Month;
            }

            if (endDate - startDate <= TimeSpan.FromDays(31))
            {
                returnDate.Month = startDate.Month;
            }

            returnDate.Year = startDate.Year;
            return(returnDate);
        }
Beispiel #2
0
        public override int GetHashCode()
        {
            int hashCode = 17; // we *know* we are using this in a dictionary, so pre-compute this

            hashCode = hashCode * 23 + Id.GetHashCode();
            hashCode = hashCode * 23 + (Fid == null ? 0 : Fid.GetHashCode());
            hashCode = hashCode * 23 + (EnableDate == null ? 0 : EnableDate.GetHashCode());
            hashCode = hashCode * 23 + (DisableDate == null ? 0 : DisableDate.GetHashCode());
            hashCode = hashCode * 23 + Dr.GetHashCode();
            hashCode = hashCode * 23 + Ts.GetHashCode();
            hashCode = hashCode * 23 + (CreateBy == null ? 0 : CreateBy.GetHashCode());
            hashCode = hashCode * 23 + (CreateDate == null ? 0 : CreateDate.GetHashCode());
            hashCode = hashCode * 23 + (CreateName == null ? 0 : CreateName.GetHashCode());
            hashCode = hashCode * 23 + (UpdateBy == null ? 0 : UpdateBy.GetHashCode());
            hashCode = hashCode * 23 + (UpdateDate == null ? 0 : UpdateDate.GetHashCode());
            hashCode = hashCode * 23 + (UpdateName == null ? 0 : UpdateName.GetHashCode());
            hashCode = hashCode * 23 + (TableName == null ? 0 : TableName.GetHashCode());
            hashCode = hashCode * 23 + (TableComment == null ? 0 : TableComment.GetHashCode());
            hashCode = hashCode * 23 + (TableMode == null ? 0 : TableMode.GetHashCode());
            hashCode = hashCode * 23 + (SubTable == null ? 0 : SubTable.GetHashCode());
            hashCode = hashCode * 23 + IsTree.GetHashCode();
            hashCode = hashCode * 23 + IsPagination.GetHashCode();
            hashCode = hashCode * 23 + IsSync.GetHashCode();

            return(hashCode);
        }
Beispiel #3
0
        public override string ToString()
        {
            string str = "";

            str += "&idserver=\"" + IDServer.ToString() + "\"";

            if (IDUser != -1)
            {
                str += "&iduser=\"" + IDUser.ToString() + "\"";
            }
            if (WValue != 0)
            {
                str += "&weight=\"" + WValue.ToString() + "\"";
            }
            if (WeightDate != null)
            {
                str += "&weightdate=\"" + WeightDate.ToString("yyyy-MM-dd HH:mm:ss") + "\"";
            }
            if (InsertDate != null)
            {
                str += "&insertdate=\"" + InsertDate.ToString("yyyy-MM-dd HH:mm:ss") + "\"";
            }
            if (UpdateDate != null)
            {
                str += "&updatedate=\"" + UpdateDate.ToString("yyyy-MM-dd HH:mm:ss") + "\"";
            }

            return(str.Substring(1));
        }
Beispiel #4
0
        public bool IsOverUpdateSortOrderTime(ForumSettingItem forumSetting)
        {
            int seconds = forumSetting.UpdateThreadSortOrderIntervals.GetValue(PostUserID);

            if (seconds == 0)
            {
                return(false);
            }
            return(UpdateDate.AddSeconds(seconds) <= DateTimeUtil.Now);
        }
        /// <summary>
        /// Returns true if PerformanceReport instances are equal
        /// </summary>
        /// <param name="other">Instance of PerformanceReport to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(PerformanceReport other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     UpdateDate == other.UpdateDate ||
                     UpdateDate != null &&
                     UpdateDate.Equals(other.UpdateDate)
                     ) &&
                 (
                     Ta == other.Ta ||
                     Ta != null &&
                     Ta.Equals(other.Ta)
                 ) &&
                 (
                     Na == other.Na ||
                     Na != null &&
                     Na.Equals(other.Na)
                 ) &&
                 (
                     Epsgr == other.Epsgr ||
                     Epsgr != null &&
                     Epsgr.Equals(other.Epsgr)
                 ) &&
                 (
                     Roew == other.Roew ||
                     Roew != null &&
                     Roew.Equals(other.Roew)
                 ) &&
                 (
                     Epsd == other.Epsd ||
                     Epsd != null &&
                     Epsd.Equals(other.Epsd)
                 ) &&
                 (
                     Grgr == other.Grgr ||
                     Grgr != null &&
                     Grgr.Equals(other.Grgr)
                 ) &&
                 (
                     Opgr == other.Opgr ||
                     Opgr != null &&
                     Opgr.Equals(other.Opgr)
                 ));
        }
Beispiel #6
0
        public override int GetHashCode()
        {
            int hashCode = 1540013303;

            hashCode = hashCode * -1521134295 + DocEntry.GetHashCode();
            hashCode = hashCode * -1521134295 + DocNum.GetHashCode();
            hashCode = hashCode * -1521134295 + DocDate.GetHashCode();
            hashCode = hashCode * -1521134295 + DocDueDate.GetHashCode();
            hashCode = hashCode * -1521134295 + TaxDate.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(DocStatus);

            hashCode = hashCode * -1521134295 + UpdateDate.GetHashCode();
            hashCode = hashCode * -1521134295 + PurchaseRequestId.GetHashCode();
            return(hashCode);
        }
Beispiel #7
0
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        UpdateDate.Update();
        Approved.Update();
        ResUpdate.Update();
        TagUpdate.Update();
        DataView dv = (DataView)AfftectedSelect.Select(DataSourceSelectArguments.Empty);
        int      x  = 0;

        foreach (DataRow dr in dv.Table.Rows)
        {
            Session["rr"] = (int)dv.Table.Rows[x][0];
            Session["gg"] = "Event Date Already Reserved";
            ccancel.Insert();
        }
        Response.Redirect("~/admin/RFR.aspx?rr=0");
    }
        public OutletItemRemarkHolder(View itemView, IOutletItemDetailRemarkClickListener listener) : base(itemView)
        {
            this.mListener = listener;

            Remark     = itemView.FindViewById <TextView>(Resource.Id.item_remark_remarks);
            UpdateDate = itemView.FindViewById <TextView>(Resource.Id.item_remark_remark_date);
            Edit       = itemView.FindViewById <TextView>(Resource.Id.item_remark_edit);
            TextBox    = itemView.FindViewById <TextView>(Resource.Id.item_remark_text_view);

            Remark.SetOnClickListener(null);
            Remark.Clickable = false;
            UpdateDate.SetOnClickListener(null);
            UpdateDate.Clickable = false;

            Edit.SetOnClickListener(this);
            TextBox.SetOnClickListener(this);
        }
Beispiel #9
0
 public string ToCSVLine(string delimiter = "|")
 {
     return(string.Join("|", new[]
     {
         DateTime.Now.ToString("o"),
         Uri.ToString(),
         Title,
         PostDate.ToString("o"),
         UpdateDate.ToString("o"),
         Category,
         Price.ToString("c"),
         Location,
         Description.Replace("|", "/").Replace("\n", "\\n"),
         string.Join(",", Images.Select(i => i.ToString()))
     }
                        ));
 }
        public DashboardItemRCSTEHolder(View itemView, IDashboardItemRCSTEClickListener listener, DashboardFragment dashboardFragment) : base(itemView)
        {
            this.mListener         = listener;
            this.dashboardFragment = dashboardFragment;

            Remark     = itemView.FindViewById <TextView>(Resource.Id.item_rcste_remarks);
            UpdateDate = itemView.FindViewById <TextView>(Resource.Id.item_rcste_remark_date);
            Edit       = itemView.FindViewById <TextView>(Resource.Id.item_rcste_edit);
            TextBox    = itemView.FindViewById <TextView>(Resource.Id.item_rcste_text_view);

            Remark.SetOnClickListener(null);
            Remark.Clickable = false;
            UpdateDate.SetOnClickListener(null);
            UpdateDate.Clickable = false;

            Edit.SetOnClickListener(this);
            TextBox.SetOnClickListener(this);
        }
Beispiel #11
0
        private static bool ValidDay(UpdateDate updateDate)
        {
            if (updateDate == null)
            {
                return(false);
            }

            try
            {
                var dateTime = new DateTime(updateDate.Year, updateDate.Month, updateDate.Day);
            }
            catch
            {
                return(false);
            }

            return(true);
        }
Beispiel #12
0
        public static DateTime FindStartDateFromUpdateDate(UpdateDate updateDate)
        {
            if (updateDate == null || (updateDate.Year == 0 && updateDate.Month == 0 && updateDate.Day == 0))
            {
                return(new DateTime());
            }

            if (ValidDay(updateDate))
            {
                return(new DateTime(updateDate.Year, updateDate.Month, updateDate.Day));
            }

            if (updateDate.Year != 0 && ValidMonth(updateDate.Month))
            {
                return(new DateTime(updateDate.Year, updateDate.Month, 1));
            }

            return(new DateTime(updateDate.Year, 1, 1));
        }
        // POST: api/Tenant/UpdateTenant
        public HttpResponseMessage UpdateTenant([FromBody] UpdateDate updatedDate)
        {
            String resp;

            try
            {
                using (var context = new NestinDBEntities())
                {
                    List <SocietyUser> users = (from u in context.SocietyUsers
                                                where u.ResID == updatedDate.id && u.Type == "Tenant"
                                                select u).ToList();

                    foreach (SocietyUser user in users)
                    {
                        user.DeActiveDate = DateTime.ParseExact(updatedDate.date, "dd/MM/yyyy", CultureInfo.InvariantCulture);
                    }

                    context.SaveChanges();

                    resp = "{\"Response\":\"OK\"}";
                }

                var response = Request.CreateResponse(HttpStatusCode.OK);
                response.Content = new StringContent(resp, System.Text.Encoding.UTF8, "application/json");
                return(response);
            }

            catch (DbEntityValidationException dbEx)
            {
                foreach (var validationErrors in dbEx.EntityValidationErrors)
                {
                    foreach (var validationError in validationErrors.ValidationErrors)
                    {
                        Log.log("api/Profile Failed to Add User : Property-" + validationError.PropertyName + "  Error- " + validationError.ErrorMessage + "  At " + DateTime.Now.ToString());
                    }
                }
                resp = "{\"Response\":\"Fail\"}";
                var response = Request.CreateResponse(HttpStatusCode.OK);
                response.Content = new StringContent(resp, System.Text.Encoding.UTF8, "application/json");
                return(response);
            }
        }
Beispiel #14
0
        public override int GetHashCode()
        {
            int hashCode = 17; // we *know* we are using this in a dictionary, so pre-compute this

            hashCode = hashCode * 23 + Id.GetHashCode();
            hashCode = hashCode * 23 + (Fid == null ? 0 : Fid.GetHashCode());
            hashCode = hashCode * 23 + (EnableDate == null ? 0 : EnableDate.GetHashCode());
            hashCode = hashCode * 23 + (DisableDate == null ? 0 : DisableDate.GetHashCode());
            hashCode = hashCode * 23 + Dr.GetHashCode();
            hashCode = hashCode * 23 + Ts.GetHashCode();
            hashCode = hashCode * 23 + (CreateBy == null ? 0 : CreateBy.GetHashCode());
            hashCode = hashCode * 23 + (CreateDate == null ? 0 : CreateDate.GetHashCode());
            hashCode = hashCode * 23 + (CreateName == null ? 0 : CreateName.GetHashCode());
            hashCode = hashCode * 23 + (UpdateBy == null ? 0 : UpdateBy.GetHashCode());
            hashCode = hashCode * 23 + (UpdateDate == null ? 0 : UpdateDate.GetHashCode());
            hashCode = hashCode * 23 + (UpdateName == null ? 0 : UpdateName.GetHashCode());
            hashCode = hashCode * 23 + (TableName == null ? 0 : TableName.GetHashCode());
            hashCode = hashCode * 23 + (ColName == null ? 0 : ColName.GetHashCode());
            hashCode = hashCode * 23 + (ColComment == null ? 0 : ColComment.GetHashCode());
            hashCode = hashCode * 23 + (ColDefault == null ? 0 : ColDefault.GetHashCode());
            hashCode = hashCode * 23 + (ColType == null ? 0 : ColType.GetHashCode());
            hashCode = hashCode * 23 + ColProperty.GetHashCode();
            hashCode = hashCode * 23 + ColLength.GetHashCode();
            hashCode = hashCode * 23 + DisplayWidth.GetHashCode();
            hashCode = hashCode * 23 + ColOrder.GetHashCode();
            hashCode = hashCode * 23 + ColPrecision.GetHashCode();
            hashCode = hashCode * 23 + NullAble.GetHashCode();
            hashCode = hashCode * 23 + ShowAble.GetHashCode();
            hashCode = hashCode * 23 + IsDefaultCol.GetHashCode();
            hashCode = hashCode * 23 + (CtrlType == null ? 0 : CtrlType.GetHashCode());
            hashCode = hashCode * 23 + (RefTable == null ? 0 : RefTable.GetHashCode());
            hashCode = hashCode * 23 + (RefID == null ? 0 : RefID.GetHashCode());
            hashCode = hashCode * 23 + (RefCode == null ? 0 : RefCode.GetHashCode());
            hashCode = hashCode * 23 + (RefName == null ? 0 : RefName.GetHashCode());
            hashCode = hashCode * 23 + (RefCondition == null ? 0 : RefCondition.GetHashCode());
            hashCode = hashCode * 23 + (RefCols == null ? 0 : RefCols.GetHashCode());
            hashCode = hashCode * 23 + (RefType == null ? 0 : RefType.GetHashCode());
            hashCode = hashCode * 23 + (MainTable == null ? 0 : RefType.GetHashCode());
            hashCode = hashCode * 23 + (MainTableCol == null ? 0 : MainTableCol.GetHashCode());
            hashCode = hashCode * 23 + (CalculationExpr == null ? 0 : CalculationExpr.GetHashCode());
            return(hashCode);
        }
Beispiel #15
0
        public static DateTime FindEndDateFromUpdateDate(UpdateDate updateDate)
        {
            if (updateDate == null || (updateDate.Year == 0 && updateDate.Month == 0 && updateDate.Day == 0))
            {
                return(new DateTime());
            }

            if (ValidDay(updateDate))
            {
                return(new DateTime());
            }

            if (updateDate.Year != 0 && ValidMonth(updateDate.Month))
            {
                var firstDayOfMonth = new DateTime(updateDate.Year, updateDate.Month, 1);
                return(firstDayOfMonth.AddMonths(1).AddDays(-1));
            }

            return(new DateTime(updateDate.Year, 12, 31));
        }
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked            // Overflow is fine, just wrap
     {
         int hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (UpdateDate != null)
         {
             hashCode = hashCode * 59 + UpdateDate.GetHashCode();
         }
         if (Ta != null)
         {
             hashCode = hashCode * 59 + Ta.GetHashCode();
         }
         if (Na != null)
         {
             hashCode = hashCode * 59 + Na.GetHashCode();
         }
         if (Epsgr != null)
         {
             hashCode = hashCode * 59 + Epsgr.GetHashCode();
         }
         if (Roew != null)
         {
             hashCode = hashCode * 59 + Roew.GetHashCode();
         }
         if (Epsd != null)
         {
             hashCode = hashCode * 59 + Epsd.GetHashCode();
         }
         if (Grgr != null)
         {
             hashCode = hashCode * 59 + Grgr.GetHashCode();
         }
         if (Opgr != null)
         {
             hashCode = hashCode * 59 + Opgr.GetHashCode();
         }
         return(hashCode);
     }
 }
 public override int GetHashCode()
 {
     unchecked {
         int result = (comments != null ? comments.GetHashCode() : 0);
         result = (result * 397) ^ (versions != null ? versions.GetHashCode() : 0);
         result = (result * 397) ^ (fixVersions != null ? fixVersions.GetHashCode() : 0);
         result = (result * 397) ^ (SubtaskKeys.GetHashCode());
         result = (result * 397) ^ (IssueLinks.GetHashCode());
         result = (result * 397) ^ (components != null ? components.GetHashCode() : 0);
         result = (result * 397) ^ (attachments != null ? attachments.GetHashCode() : 0);
         result = (result * 397) ^ (Server != null ? Server.GUID.GetHashCode() : 0);
         result = (result * 397) ^ (IssueType != null ? IssueType.GetHashCode() : 0);
         result = (result * 397) ^ IssueTypeId;
         result = (result * 397) ^ (IssueTypeIconUrl != null ? IssueTypeIconUrl.GetHashCode() : 0);
         result = (result * 397) ^ (Description != null ? Description.GetHashCode() : 0);
         result = (result * 397) ^ Id;
         result = (result * 397) ^ (Key != null ? Key.GetHashCode() : 0);
         result = (result * 397) ^ (Summary != null ? Summary.GetHashCode() : 0);
         result = (result * 397) ^ (Status != null ? Status.GetHashCode() : 0);
         result = (result * 397) ^ (StatusIconUrl != null ? StatusIconUrl.GetHashCode() : 0);
         result = (result * 397) ^ (Priority != null ? Priority.GetHashCode() : 0);
         result = (result * 397) ^ (Resolution != null ? Resolution.GetHashCode() : 0);
         result = (result * 397) ^ (Reporter != null ? Reporter.GetHashCode() : 0);
         result = (result * 397) ^ (Assignee != null ? Assignee.GetHashCode() : 0);
         result = (result * 397) ^ CreationDate.GetHashCode();
         result = (result * 397) ^ UpdateDate.GetHashCode();
         result = (result * 397) ^ (ProjectKey != null ? ProjectKey.GetHashCode() : 0);
         result = (result * 397) ^ (Environment != null ? Environment.GetHashCode() : 0);
         result = (result * 397) ^ (OriginalEstimate != null ? OriginalEstimate.GetHashCode() : 0);
         result = (result * 397) ^ (RemainingEstimate != null ? RemainingEstimate.GetHashCode() : 0);
         result = (result * 397) ^ (TimeSpent != null ? TimeSpent.GetHashCode() : 0);
         result = (result * 397) ^ (ParentKey != null ? ParentKey.GetHashCode() : 0);
         result = (result * 397) ^ (PriorityIconUrl != null ? PriorityIconUrl.GetHashCode() : 0);
         result = (result * 397) ^ StatusId;
         result = (result * 397) ^ PriorityId;
         return(result);
     }
 }
Beispiel #18
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string sttt = "";

        sttt = DateTime.Now.ToLongTimeString();
        if (sttt.Length == 10)
        {
            sttt = "0" + sttt;
        }
        string post = sttt.Substring(9, 2);

        if (post == "PM")
        {
            int h = Convert.ToInt32(sttt.Substring(0, 2)) + 12;
            TTime.Text = h.ToString() + sttt.Substring(2, 6);
        }
        else
        {
            TTime.Text = sttt.Substring(0, 8);
        }
        deduct.Update();
        UpdateTag.Update();
        UpdateDate.Insert();
        PaymentInsert.Insert();
        DataView dv = (DataView)AfftectedSelect.Select(DataSourceSelectArguments.Empty);
        int      x  = 0;

        foreach (DataRow dr in dv.Table.Rows)
        {
            Session["rr"] = (int)dv.Table.Rows[x][0];
            Session["gg"] = "Event Date Already Reserved";
            ccancel.Insert();
        }
        printhead.Visible = true;
        Button1.Enabled   = false;
        TextBox3.ReadOnly = true;
        Button2.Enabled   = false;
    }
Beispiel #19
0
        public override string ToString()
        {
            string str = "";

            if (IDUser != -1)
            {
                str += "&iduser=\"" + IDUser.ToString() + "\"";
            }
            if (!AccessToken.Equals(""))
            {
                str += "&accesstoken=\"" + Uri.EscapeDataString(AccessToken) + "\"";
            }
            if (FacebookID != -1)
            {
                str += "&iduser=\"" + FacebookID.ToString() + "\"";
            }
            if (!FirstName.Equals(""))
            {
                str += "&firstname=\"" + Uri.EscapeDataString(FirstName) + "\"";
            }
            if (!LastName.Equals(""))
            {
                str += "&lastname=\"" + Uri.EscapeDataString(LastName) + "\"";
            }
            if (Gender != -1)
            {
                str += "&gender=\"" + Gender.ToString() + "\"";
            }
            if (!Email.Equals(""))
            {
                str += "&email=\"" + Uri.EscapeDataString(Email) + "\"";
            }
            if (!Password.Equals(""))
            {
                str += "&password=\"" + Password + "\"";
            }
            if (!Location.Equals(""))
            {
                str += "&location=\"" + Location + "\"";
            }
            if (Height != -1)
            {
                str += "&height=\"" + Height.ToString() + "\"";
            }
            if (HeightType != -1)
            {
                str += "&heighttype=\"" + HeightType.ToString() + "\"";
            }
            if (Skeleton != 0)
            {
                str += "&skeleton=\"" + Skeleton.ToString() + "\"";
            }
            if (fertility != -1)
            {
                str += "&fertility=\"" + Fertility.ToString() + "\"";
            }
            if (Birthdate != null)
            {
                str += "&birthdate=\"" + Birthdate.Value.ToString("yyyy-MM-dd HH:mm:ss") + "\"";
            }
            if (RemindDate != null)
            {
                str += "&reminddate=\"" + RemindDate.Value.ToString("yyyy-MM-dd HH:mm:ss") + "\"";
            }
            if (InsertDate != DateTime.MinValue)
            {
                str += "&insertdate=\"" + InsertDate.ToString("yyyy-MM-dd HH:mm:ss") + "\"";
            }
            if (UpdateDate != DateTime.MinValue)
            {
                str += "&updatedate=\"" + UpdateDate.ToString("yyyy-MM-dd HH:mm:ss") + "\"";
            }
            if (AdjustDiet != -1)
            {
                str += "&adjustdiet=\"" + AdjustDiet.ToString() + "\"";
            }
            return(str.Substring(1));
        }
Beispiel #20
0
 public override string ToString()
 {
     return(Ticker + " (" + UpdateDate.ToShortDateString() + "): " + Last.ToString());
 }
Beispiel #21
0
 public override int GetHashCode()
 {
     return(UpdateDate.GetHashCode());
 }