Esempio n. 1
0
        public override int GetHashCode()
        {
            var hashCode = 77621969;

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Id);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(PriceFileId);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(ExternalRefId);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(ProductId);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(PartId);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Sku);

            hashCode = hashCode * -1521134295 + PriceNet.GetHashCode();
            hashCode = hashCode * -1521134295 + PriceNetFull.GetHashCode();
            hashCode = hashCode * -1521134295 + PriceRetail.GetHashCode();
            hashCode = hashCode * -1521134295 + PriceRetailFull.GetHashCode();
            hashCode = hashCode * -1521134295 + DateStart.GetHashCode();
            hashCode = hashCode * -1521134295 + DateEnd.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(PromoCode);

            hashCode = hashCode * -1521134295 + EqualityComparer <long?> .Default.GetHashCode(Priority);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Note);

            return(hashCode);
        }
Esempio n. 2
0
        private void AddMedicalDoc()
        {
            var MedicalDoc = new MedicalDoc();

            MedicalDoc.Comment   = Comment;
            MedicalDoc.DateStart = DateStart;
            MedicalDoc.DateEnd   = DateEnd;
            MedicalDoc.Person_ID = SelectedStudent.Person.ID;

            using (var _context = new ApplicationContext())
            {
                var newEndDate = DateEnd.AddDays(1).Date;
                Journals = new ObservableCollection <Journal>(_context.Journals
                                                              .Where(x => x.Date >= DateStart.Date && x.Date < newEndDate)
                                                              .Where(x => x.Student.Person_ID == SelectedStudent.Person.ID)
                                                              .Where(x => x.Assessment.Type == 1)
                                                              .Include(x => x.Student)
                                                              .Include(x => x.Assessment));

                var RespectfulReason = _context.Assessments.Where(x => x.Type == 2).FirstOrDefault();

                foreach (var item in Journals)
                {
                    item.Assessment            = RespectfulReason;
                    _context.Entry(item).State = EntityState.Modified;
                }
                _context.MedicalDocs.Add(MedicalDoc);
                _context.SaveChanges();
                EventsManager.RaiseObjectChangedEvent(MedicalDoc, ChangeType.Added);
            }
        }
Esempio n. 3
0
        private bool Validation()
        {
            bool result = true;

            if (result && (txtName.Text == null || txtName.Text.Trim() == string.Empty))
            {
                result = false;
                txtName.Focus();
                ClassLibrary.JMessages.Error("لطفاً عنوان را وارد کنید.", "");
            }

            if (result && DateStart.Date != DateTime.MinValue && !DateStart.IsValidDate())
            {
                result = false;
                DateStart.Focus();
                ClassLibrary.JMessages.Error("تاریخ آغاز معتبر نیست", "");
            }

            if (result && DateEnd.Date != DateTime.MinValue && !DateEnd.IsValidDate())
            {
                result = false;
                DateEnd.Focus();
                ClassLibrary.JMessages.Error("تاریخ پایان معتبر نیست", "");
            }

            if (DateEnd.Date != DateTime.MinValue && DateStart.Date > DateEnd.Date)
            {
                ClassLibrary.JMessages.Error("لطفا تاریخ شروع و پایان را بصورت صحیح وارد کنید", "خطا");
                return(false);
            }
            return(result);
        }
Esempio n. 4
0
        public string exportAsICS()
        {
            //create a new stringbuilder instance
            StringBuilder sb = new StringBuilder();

            //start the calendar item
            sb.AppendLine("BEGIN:VCALENDAR");
            sb.AppendLine("VERSION:2.0");
            sb.AppendLine("PRODID:BilleterieEPITA");

            //add the event
            sb.AppendLine("BEGIN:VEVENT");

            //DTSTART: Date de début de l'événement
            sb.AppendLine("DTSTART;TZID=Europe/Paris:" + DateStart.ToString("yyyyMMddTHHmm00"));
            //sb.AppendLine("DTSTART:" + DateStart.ToString("yyyyMMddTHHmm00"));
            //DTEND: Date de fin de l'événement
            sb.AppendLine("DTEND;TZID=Europe/Paris:" + DateEnd.ToString("yyyyMMddTHHmm00"));
            //sb.AppendLine("DTEND:" + DateEnd.ToString("yyyyMMddTHHmm00"));

            sb.AppendLine("ORGANIZER:CN=" + Organizer + ":MAILTO:" + OrganizerEmail);

            //SUMMARY: Titre de l'événement
            sb.AppendLine("SUMMARY:" + Summary + "");
            //LOCATION: Lieu de l'événement
            sb.AppendLine("LOCATION:" + Location + "");
            //DESCRIPTION: Description de l'événement
            sb.AppendLine("DESCRIPTION:" + Description + "");

            //CATEGORIES: Catégorie de l'événement (ex: Conférence, Fête...)
            //STATUS: Statut de l'événement (TENTATIVE, CONFIRMED, CANCELLED)
            //TRANSP: Définit si la ressource affectée à l'événement est rendu indisponible (OPAQUE, TRANSPARENT)
            //SEQUENCE: Nombre de mises à jour, la première mise à jour est à 1


            sb.AppendLine("PRIORITY:" + Priority.ToString());

            sb.AppendLine("END:VEVENT");

            //end calendar item
            sb.AppendLine("END:VCALENDAR");

            //create a string from the stringbuilder
            string CalendarItem = sb.ToString();

            return(CalendarItem);
            //send the calendar item to the browser

            /*
             * Response.ClearHeaders();
             * Response.Clear();
             * Response.Buffer = true;
             * Response.ContentType = "text/calendar";
             * Response.AddHeader("content-length", CalendarItem.Length.ToString());
             * Response.AddHeader("content-disposition", "attachment; filename=\"" + FileName + ".ics\"");
             * Response.Write(CalendarItem);
             * Response.Flush();
             * HttpContext.Current.ApplicationInstance.CompleteRequest();
             */
        }
Esempio n. 5
0
        protected bool validData()
        {
            bool result = true;

            if (txtDep.Text == "")
            {
                ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "alert", " alert('查詢明細表時,部門編號不能為空!');", true);
                txtDep.Focus();
                result = false;
            }

            if (DateStart.Value.Trim() != "" && StrHlp.CheckDateFormat(DateStart.Value.Trim()) == false)
            {
                ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "alert", " alert('批準日期格式不正確!');", true);
                DateStart.Focus();
                result = false;
            }
            else
            {
                if (DateEnd.Value.Trim() != "" && StrHlp.CheckDateFormat(DateEnd.Value.Trim()) == false)
                {
                    StrHlp.WebMessageBox(this.Page, "批準日期格式錯誤!");
                    DateEnd.Focus();
                    result = false;
                }
            }


            return(result);
        }
Esempio n. 6
0
        //ToString returns string with info about the contract
        public override string ToString()
        {
            string result = "";

            result += string.Format("Number Of Contract:{0}\n", NumberOfContract);
            result += string.Format("Nunny ID:{0}\n", NunnyID);
            result += string.Format("Mother ID:{0}\n", MotherID);
            result += string.Format("Child ID:{0}\n", ChildID);
            result += string.Format("Was there Interview?{0}\n", IsInterview);
            result += string.Format("Rate for Hour: {0}\n", RateforHour);
            result += string.Format("Rate for Month: {0}\n", RateforMonth);
            result += string.Format("Is there any more children in the nunny? {0}\n", IsMorechilds);
            result += "Work Time:\n";
            foreach (var item in WorkTime)  //loop over days in week
            {
                result += "day: " + item.Key + "   \t";
                result += "hours " + ((((item.Value.Key) / 100) < 10) ? ("0") : (null)) + ((item.Value.Key) / 100);
                result += ":" + ((((item.Value.Key) % 100) < 10) ? "0" : (null)) + (item.Value.Key) % 100 + " - ";
                result += ((((item.Value.Value) / 100) < 10) ? ("0") : (null)) + (item.Value.Value) / 100;
                result += ":" + ((((item.Value.Value) % 100) < 10) ? "0" : (null)) + (item.Value.Value) % 100 + '\n';
            }
            result += string.Format("Date of Start:{0}\n", DateStart.ToShortDateString());
            result += string.Format("Date of End: {0}\n", DateEnd.ToShortDateString());
            result += string.Format("Hours Of Contract: {0}\n", HoursOfContractMonth);
            return(result);
        }
 public ManageExpensesListViewModel()
 {
     this.DateBegin = new DateTime(DateTime.Now.Year, 1, 1, 0, 0, 0, 0);
     this.DateEnd   = new DateTime(DateTime.Now.Year, 12, 31, 23, 59, 59, 999);
     this.Dat1      = DateBegin.ToString("MM/dd/yyyy");
     this.Dat2      = DateEnd.ToString("MM/dd/yyyy");
 }
Esempio n. 8
0
        }         // DueCurrencyCode

        public override string ToString()
        {
            return(string.Format("{0} - {1}: {2} {3}, {4} {5}",
                                 DateStart.ToString("MMM d yyyy", CultureInfo.InvariantCulture),
                                 DateEnd.ToString("MMM d yyyy", CultureInfo.InvariantCulture),
                                 PaidAmount, PaidCurrencyCode,
                                 DueAmount, DueCurrencyCode
                                 ));
        }         // ToString
 public ManageExpensesListViewModel(User user, string dat1, string dat2) : base()
 {
     First_Name     = user.First_Name;
     Last_Name      = user.Last_Name;
     Email          = user.Email;
     this.DateBegin = Convert.ToDateTime(dat1);
     this.DateEnd   = Convert.ToDateTime(dat2);
     this.Dat1      = DateBegin.ToString("MM/dd/yyyy");
     this.Dat2      = DateEnd.ToString("MM/dd/yyyy");
     UserId         = user.UserId;
 }
Esempio n. 10
0
        private void ButtonDateSelect_Click(object sender, RoutedEventArgs e)
        {
            string param = (sender as Button).Tag.ToString();

            if (param.Equals("EquateEndDateToBeginDate"))
            {
                DateEnd = DateBegin;
            }
            else if (param.Equals("SetDatesToCurrentDay"))
            {
                DateBegin = DateTime.Now;
                DateEnd   = DateBegin;
            }
            else if (param.Equals("SetDatesToCurrentWeek"))
            {
                DateEnd = DateTime.Now;
                int dayOfWeek = (int)DateEnd.DayOfWeek;
                if (dayOfWeek == 0)
                {
                    dayOfWeek = 7;
                }
                DateBegin = DateEnd.AddDays(-1 * (dayOfWeek - 1));
            }
            else if (param.Equals("SetDatesToCurrentMonth"))
            {
                DateBegin = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
                DateEnd   = DateBegin.AddDays(DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month) - 1);
            }
            else if (param.Equals("SetDatesToCurrentYear"))
            {
                DateBegin = new DateTime(DateTime.Now.Year, 1, 1);
                DateEnd   = new DateTime(DateTime.Now.Year, 12, DateTime.DaysInMonth(DateTime.Now.Year, 12));
            }
            else if (param.Equals("GoToPreviousMonth"))
            {
                DateEnd   = new DateTime(DateBegin.Year, DateBegin.Month, 1).AddDays(-1);
                DateBegin = DateEnd.AddDays(-1 * (DateTime.DaysInMonth(DateEnd.Year, DateEnd.Month) - 1));
            }
            else if (param.Equals("GoToPreviousDay"))
            {
                DateBegin = DateBegin.AddDays(-1);
                DateEnd   = DateBegin;
            }
            else if (param.Equals("GoToNextDay"))
            {
                DateBegin = DateBegin.AddDays(1);
                DateEnd   = DateBegin;
            }
            else if (param.Equals("GoToNextMonth"))
            {
                DateBegin = new DateTime(DateBegin.Year, DateBegin.Month, DateTime.DaysInMonth(DateBegin.Year, DateBegin.Month)).AddDays(1);
                DateEnd   = DateBegin.AddDays((DateTime.DaysInMonth(DateBegin.Year, DateBegin.Month) - 1));
            }
        }
Esempio n. 11
0
        private void BtnAddCalculatedMetrics_Click(object sender, EventArgs e)
        {
            string DeviceID, MetricValue;
            //int MetricID;
            DateTime DateStart, DateEnd;

            DeviceID = MetricValue = default;
            // MetricID = default;
            DateStart = DateEnd = default;


            if (String.IsNullOrEmpty(textBox3.Text))
            {
                MessageBox.Show("Gngn vraies valeurs svp");
                return; //Arrete tout si jamais c'est le cas
            }
            else
            {
                MetricValue = textBox3.Text; //On est dans le cas ou c'est good
            }
            //if (MetricID == default)
            //{
            //    MetricID = "";
            //}
            if (DeviceID == default)
            {
                //DeviceID = GetRandomMacAddress();
                var random = new Random();
                DeviceID = (1 + random.Next(100)).ToString();
            }
            else if (MetricValue == default)
            {
                var random = new Random();
                MetricValue = (1 + random.Next()).ToString();
            }
            else if (DateStart == default)
            {
                DateStart = DateTime.Now;
                string formatForMySql = DateStart.ToString("yyyy-MM-dd HH:mm:ss");
            }
            else if (DateEnd == default)
            {
                DateEnd = DateTime.Now;
                string formatForMySql = DateEnd.ToString("yyyy-MM-dd HH:mm:ss");
            }

            if (DeviceID == default && MetricValue == default)
            {
            }
            DAL.PostCalculatedMetrics(DeviceID, MetricValue, DateStart, DateEnd, 0);
        }
Esempio n. 12
0
        protected override void OnInitialize()
        {
            base.OnInitialize();

            DbReloadToken
            .Merge(DateBegin.Changed())
            .Merge(DateEnd.Changed())
            .Merge(SupplierCostBegin.Changed())
            .Merge(SupplierCostEnd.Changed())
            .Merge(RetailCostBegin.Changed())
            .Merge(RetailCostEnd.Changed())
            .SelectMany(_ => RxQuery(LoadItems))
            .Subscribe(Items);
        }
Esempio n. 13
0
        public override string ToString()
        {
            string line =
                " " + StringUtil.FillSpaceLeft(SiteCode, 4)
                + " " + StringUtil.FillSpaceLeft(PointCode, 2)
                + " " + StringUtil.FillSpaceLeft(SolutionID, 4)
                + " " + ObservationCode
                + " " + DateStart.ToYdsString()
                + " " + DateEnd.ToYdsString()
                + " " + DateMean.ToYdsString()
            ;

            return(line);
        }
Esempio n. 14
0
        public byte[] GetMascotInfo()
        {
            var result = new PangyaBinaryWriter();

            result.Write(MID);
            result.Write(MASCOT_TYPEID);
            result.Write(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00 });
            result.WriteStr(MESSAGE, 16);
            result.WriteEmptyBytes(length: 14);
            result.Write((short)END_DATE_INT.Value);
            result.Write(DateEnd?.ToPangyaDateTime());
            result.Write((byte)0);

            return(result.GetBytes());
        }
Esempio n. 15
0
        /// <summary>
        /// *SITE PT SOLN TProduct DATA_START__ DATA_END____ DESCRIPTION_________ S/N__ FIRMWARE___
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            string line =
                " " + StringUtil.FillSpaceLeft(SiteCode, 4)
                + " " + StringUtil.FillSpaceLeft(PointCode, 2)
                + " " + StringUtil.FillSpaceLeft(SolutionID, 4)
                + " " + ObservationCode
                + " " + DateStart.ToYdsString()
                + " " + DateEnd.ToYdsString()
                + " " + StringUtil.FillSpaceLeft(AntennaType, 20)
                + " " + StringUtil.FillSpaceLeft(AntennaSerialNumber, 5)
            ;

            return(line);
        }
Esempio n. 16
0
        public virtual void Capitalization()
        {
            if (DateEnd.AddMonths(1).CompareTo(DateCapitalization) >= 0)
            {
                DateTime date = DateTime.Today;
                //DateTime date1 = new DateTime(2016, 6, 4);
                //Console.WriteLine($"{date1}");

                if (DateCapitalization.CompareTo(date) == 0)
                {
                    RefillInterestRate();
                    _dateCapitalization = _dateCapitalization.AddMonths(1);
                }
            }
        }
Esempio n. 17
0
        public override string ToString()
        {
            string line =
                " " + StringUtil.FillSpaceLeft(SiteCode, 4)
                + " " + StringUtil.FillSpaceLeft(PointCode, 2)
                + " " + StringUtil.FillSpaceLeft(SolutionID, 4)
                + " " + ObservationCode
                + " " + DateStart.ToYdsString()
                + " " + DateEnd.ToYdsString()
                + " " + StringUtil.FillSpaceLeft(EccentricityReferenceSystem, 3)
                + " " + Une.ToRnxString(8.4)
            ;

            return(line);
        }
Esempio n. 18
0
        public string exportAsICS(Models.Event ev)
        {
            DateStart   = ev.Begin;
            DateEnd     = ev.End;
            Organizer   = ev.Assoc;
            Summary     = ev.Name;
            Description = ev.Description;
            Location    = "FIXME";
            try
            {
                object email = Database.Database.database.RequestObject("f_email", ev.Owner);
                OrganizerEmail = (string)email;
            }
            catch (Exception) { }


            //create a new stringbuilder instance
            StringBuilder sb = new StringBuilder();

            //start the calendar item
            sb.AppendLine("BEGIN:VCALENDAR");
            sb.AppendLine("VERSION:2.0");
            sb.AppendLine("PRODID:BilleterieEPITA");

            sb.AppendLine("BEGIN:VEVENT");
            sb.AppendLine("DTSTART;TZID=Europe/Paris:" + DateStart.ToString("yyyyMMddTHHmm00"));
            sb.AppendLine("DTEND;TZID=Europe/Paris:" + DateEnd.ToString("yyyyMMddTHHmm00"));

            sb.AppendLine("ORGANIZER:CN=" + Organizer + ":MAILTO:" + OrganizerEmail);

            sb.AppendLine("SUMMARY:" + Summary);
            sb.AppendLine("LOCATION:" + Location);
            sb.AppendLine("DESCRIPTION:" + Description);

            //CATEGORIES: Catégorie de l'événement (ex: Conférence, Fête...)
            //STATUS: Statut de l'événement (TENTATIVE, CONFIRMED, CANCELLED)
            //TRANSP: Définit si la ressource affectée à l'événement est rendu indisponible (OPAQUE, TRANSPARENT)
            //SEQUENCE: Nombre de mises à jour, la première mise à jour est à 1

            sb.AppendLine("PRIORITY:" + Priority.ToString());
            sb.AppendLine("END:VEVENT");
            sb.AppendLine("END:VCALENDAR");

            //create a string from the stringbuilder
            string CalendarItem = sb.ToString();

            return(CalendarItem);
        }
        /// <summary>
        /// Returns true if SessionRequest instances are equal
        /// </summary>
        /// <param name="other">Instance of SessionRequest to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(SessionRequest other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     CreatorEmail == other.CreatorEmail ||
                     CreatorEmail != null &&
                     CreatorEmail.Equals(other.CreatorEmail)
                     ) &&
                 (
                     Title == other.Title ||
                     Title != null &&
                     Title.Equals(other.Title)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     DateBegin == other.DateBegin ||
                     DateBegin != null &&
                     DateBegin.Equals(other.DateBegin)
                 ) &&
                 (
                     DateEnd == other.DateEnd ||
                     DateEnd != null &&
                     DateEnd.Equals(other.DateEnd)
                 ) &&
                 (
                     TimeZone == other.TimeZone ||
                     TimeZone != null &&
                     TimeZone.Equals(other.TimeZone)
                 ) &&
                 (
                     SessionId == other.SessionId ||
                     SessionId != null &&
                     SessionId.Equals(other.SessionId)
                 ));
        }
Esempio n. 20
0
        public string ToMail()
        {
            IsNotificationSent = true;
            execSave();

            StringBuilder sb = new StringBuilder();

            sb.Append(Car.Grz);
            sb.Append(" ");
            sb.Append(Type);
            sb.Append(" ");
            sb.Append(Number);
            sb.Append(" ");
            sb.Append(DateEnd.ToShortDateString());
            return(sb.ToString());
        }
Esempio n. 21
0
        public int CompareTo(DateElement d)
        {
            var dateCompare = Date.CompareTo(d.Date);

            if (dateCompare != 0)
            {
                return(dateCompare);
            }

            if (_originalIndex >= 0)
            {
                return(_originalIndex < d._originalIndex ? -1 : 1);
            }

            return(-DateEnd.CompareTo(d.DateEnd));
        }
 /// <summary>
 /// Mets le chrono en pause
 /// </summary>
 /// <param name="btnPause"></param>
 public void setPause(Button btnPause)
 {
     if (!this.Pause)
     {
         this.Pause       = true;
         this.DatePause   = DateTime.Now;
         btnPause.Content = "Play";
     }
     else
     {
         this.Pause = false;
         var diff = DateTime.Now.Subtract(DatePause);
         DateEnd          = DateEnd.Add(diff);
         btnPause.Content = "Pause";
     }
 }
Esempio n. 23
0
        public override string ToString()
        {
            string drome = "";

            foreach (var item in SelectedAutodromes)
            {
                drome += item.CodeName + "\n";
            }
            if (SelectedAutodromes.Count < 1)
            {
                drome = "Все";
            }

            return($"Дата начала {DateStart.ToString("dd.MM")}\nДата конца {DateEnd.ToString("dd.MM")}\n" +
                   $"Время старта занятия больше чем {string.Format("{0:00}:{1:00}:{2:00}",TimeStart.Hours,TimeStart.Minutes,TimeStart.Seconds)}\nВыбранные площадки \"{drome}\"\n" +
                   $"Искомая фамилия учителя \"{TeacherLast}\"");
        }
Esempio n. 24
0
        public void Load(SqlConnection connection)
        {
            Clear();
            if (DateBegin == DateEnd)
            {
                DateEnd = DateEnd.AddDays(1);
            }

            var param = new List <KeyValuePair <string, object> >();

            param.Add(new KeyValuePair <string, object>("(GoodsDate >= @0", DateBegin));
            param.Add(new KeyValuePair <string, object>("and GoodsDate <= @1)", DateEnd));

            if (!string.IsNullOrEmpty(ShopCode))
            {
                param.Add(new KeyValuePair <string, object>(string.Format("and (ShopCode == @{0})", param.Count), ShopCode));
            }

            if (!string.IsNullOrEmpty(Group))
            {
                param.Add(new KeyValuePair <string, object>(string.Format("and (Group == @{0})", param.Count), Group));
            }

            if (!string.IsNullOrEmpty(Supplier))
            {
                param.Add(new KeyValuePair <string, object>(string.Format("and (Supplier == @{0})", param.Count), Supplier));
            }

            if (!string.IsNullOrEmpty(Barcode))
            {
                param.Add(new KeyValuePair <string, object>(string.Format("and (Barcode == @{0})", param.Count), Barcode));
            }
            var arr = param.Select(p => p.Value).ToArray();
            var str = string.Join(" ", param.Select(p => p.Key).ToArray());

            using (var cn = ReportData.GetContext(connection))
            {
                var dt = cn.vReportOrdersByShops.Where(str, arr);

                foreach (var item in dt)
                {
                    Add(item);
                }
            }
        }
 /// <summary>
 /// Update le label du chrono/ la progressbar s'il est pas en pause
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void UpdateChronoLabel(object sender, EventArgs e)
 {
     if (!Pause)
     {
         // Si il reste encore du temps dans le timer
         if (DateTime.Now.CompareTo(DateEnd) == -1)
         {
             var Tl = DateEnd.Subtract(DateTime.Now);
             // Met à jour le compteur
             var TimeLeft = Tl.Minutes + ":" + Tl.Seconds.ToString("00");
             this.LblChrono.Content = TimeLeft;
             //Met à jour la ProgressBar
             var timeLeftSeconds = Tl.Minutes * 60 + Tl.Seconds;
             var timeSpend       = this.TimerTime * 60 - timeLeftSeconds;
             ProgressBarTimeLeft.Value = timeSpend * 100 / (this.TimerTime * 60);
         }
     }
 }
Esempio n. 26
0
        public bool Equals(TrendingEntryDestinyRitual input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Image == input.Image ||
                     (Image != null && Image.Equals(input.Image))
                     ) &&
                 (
                     Icon == input.Icon ||
                     (Icon != null && Icon.Equals(input.Icon))
                 ) &&
                 (
                     Title == input.Title ||
                     (Title != null && Title.Equals(input.Title))
                 ) &&
                 (
                     Subtitle == input.Subtitle ||
                     (Subtitle != null && Subtitle.Equals(input.Subtitle))
                 ) &&
                 (
                     DateStart == input.DateStart ||
                     (DateStart != null && DateStart.Equals(input.DateStart))
                 ) &&
                 (
                     DateEnd == input.DateEnd ||
                     (DateEnd != null && DateEnd.Equals(input.DateEnd))
                 ) &&
                 (
                     MilestoneDetails == input.MilestoneDetails ||
                     (MilestoneDetails != null && MilestoneDetails.Equals(input.MilestoneDetails))
                 ) &&
                 (
                     EventContent == input.EventContent ||
                     (EventContent != null && EventContent.Equals(input.EventContent))
                 ));
        }
Esempio n. 27
0
        public async Task Execute(object transaction, ITelegramBotClient botClient, ILogger logger, IDbContext db)
        {
            var cuurentTransaction = transaction as CommandTransactionModel;

            var date = db.Set <DateModel>()
                       .Include(u => u.FirstUser)
                       .Include(u => u.SecondUser)
                       .FirstOrDefault(d => (d.FirstUser.TelegramId == cuurentTransaction.RecipientId ||
                                             d.SecondUser.TelegramId == cuurentTransaction.RecipientId) &&
                                       d.IsActive == true);

            if (date == null)
            {
                return;
            }

            UserModel user = db.Set <UserModel>().Find(date.FirstUser.Id);

            user.IsVisible = false;
            user.IsFree    = true;
            db.Update(user);

            user           = db.Set <UserModel>().Find(date.SecondUser.Id);
            user.IsVisible = false;
            user.IsFree    = true;
            db.Update(user);

            date.IsActive = false;
            db.Update(date);
            await db.SaveChangesAsync();

            await botClient.SendTextMessageAsync(date.FirstUser.TelegramId, Messages.DateEnd);

            await botClient.SendTextMessageAsync(date.SecondUser.TelegramId, Messages.DateEnd);

            DateEnd?.Invoke(date.Id);
        }
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (CreatorEmail != null)
         {
             hashCode = hashCode * 59 + CreatorEmail.GetHashCode();
         }
         if (Title != null)
         {
             hashCode = hashCode * 59 + Title.GetHashCode();
         }
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (DateBegin != null)
         {
             hashCode = hashCode * 59 + DateBegin.GetHashCode();
         }
         if (DateEnd != null)
         {
             hashCode = hashCode * 59 + DateEnd.GetHashCode();
         }
         if (TimeZone != null)
         {
             hashCode = hashCode * 59 + TimeZone.GetHashCode();
         }
         if (SessionId != null)
         {
             hashCode = hashCode * 59 + SessionId.GetHashCode();
         }
         return(hashCode);
     }
 }
Esempio n. 29
0
 public void ReadData()
 {
     Logger.info(String.Format("Чтение данных за {0} по объекту ", DateStart.ToString("dd.MM.yyyy")));
     foreach (KeyValuePair <string, string> de in Names)
     {
         try {
             SqlConnection con = getConnection();
             con.Open();
             string comSTR = "";
             comSTR = String.Format("SELECT DATA_DATE,VALUE0, SEASON FROM DATA WHERE OBJECT={0} AND OBJTYPE={1} AND ITEM={2} AND PARNUMBER=12 AND DATA_DATE>'{3}' AND DATA_DATE<='{4}'",
                                    Data[de.Key].Source.Obj, Data[de.Key].Source.ObjType, Data[de.Key].Source.Item, DateStart.ToString(DateFormat), DateEnd.ToString(DateFormat));
             SqlCommand    command = new SqlCommand(comSTR, con);
             SqlDataReader reader  = command.ExecuteReader();
             while (reader.Read())
             {
                 //Object dt=
                 DateTime date   = reader.GetDateTime(0);
                 double   val    = reader.GetDouble(1);
                 int      season = reader.GetInt32(2);
                 if (season >= CurrentSeason)
                 {
                     CurrentSeason = season;
                 }
                 try {
                     Data[de.Key].Values[date] = String.Format("{0:0.##}", val).Replace(",", ".");
                 } catch { }
             }
             reader.Close();
             con.Close();
         } catch (Exception e) {
             Logger.info("Ошибка при данных" + e.ToString());
         }
     }
 }
        /// <summary>
        /// CHange le label du chrono
        /// </summary>
        /// <param name="lblChrono"></param>
        public void setLabelChrono(Label lblChrono)
        {
            var Tl = DateEnd.Subtract(DateTime.Now);

            lblChrono.Content = TimerTime + ":00";
        }