public ResourceElementVM(ResourceElementOptions options, ModuleDef ownerModule, bool canDeserialize) { this.origOptions = options; this.canDeserialize = canDeserialize; this.booleanVM = new BooleanVM(a => HasErrorUpdated()); this.charVM = new CharVM(a => HasErrorUpdated()); this.byteVM = new ByteVM(a => HasErrorUpdated()); this.sbyteVM = new SByteVM(a => HasErrorUpdated()); this.int16VM = new Int16VM(a => HasErrorUpdated()); this.uint16VM = new UInt16VM(a => HasErrorUpdated()); this.int32VM = new Int32VM(a => HasErrorUpdated()); this.uint32VM = new UInt32VM(a => HasErrorUpdated()); this.int64VM = new Int64VM(a => HasErrorUpdated()); this.uint64VM = new UInt64VM(a => HasErrorUpdated()); this.singleVM = new SingleVM(a => HasErrorUpdated()); this.doubleVM = new DoubleVM(a => HasErrorUpdated()); this.decimalVM = new DecimalVM(a => HasErrorUpdated()); this.dateTimeVM = new DateTimeVM(a => HasErrorUpdated()); this.timeSpanVM = new TimeSpanVM(a => HasErrorUpdated()); this.userTypeVM = new UserTypeVM(ownerModule, canDeserialize); this.resourceElementTypeVM = new EnumListVM(resourceElementTypeList, (a, b) => OnResourceElementTypeChanged()); this.UserTypeVM.PropertyChanged += (s, e) => { if (e.PropertyName == "HasError") { HasErrorUpdated(); } }; Reinitialize(); }
public ResourceElementVM(ResourceElementOptions options, ModuleDef ownerModule, bool canDeserialize) { origOptions = options; this.canDeserialize = canDeserialize; BooleanVM = new BooleanVM(a => HasErrorUpdated()); CharVM = new CharVM(a => HasErrorUpdated()); ByteVM = new ByteVM(a => HasErrorUpdated()); SByteVM = new SByteVM(a => HasErrorUpdated()); Int16VM = new Int16VM(a => HasErrorUpdated()); UInt16VM = new UInt16VM(a => HasErrorUpdated()); Int32VM = new Int32VM(a => HasErrorUpdated()); UInt32VM = new UInt32VM(a => HasErrorUpdated()); Int64VM = new Int64VM(a => HasErrorUpdated()); UInt64VM = new UInt64VM(a => HasErrorUpdated()); SingleVM = new SingleVM(a => HasErrorUpdated()); DoubleVM = new DoubleVM(a => HasErrorUpdated()); DecimalVM = new DecimalVM(a => HasErrorUpdated()); DateTimeVM = new DateTimeVM(a => HasErrorUpdated()); TimeSpanVM = new TimeSpanVM(a => HasErrorUpdated()); UserTypeVM = new UserTypeVM(ownerModule, canDeserialize); ResourceElementTypeVM = new EnumListVM(resourceElementTypeList, (a, b) => OnResourceElementTypeChanged()); UserTypeVM.PropertyChanged += (s, e) => { if (e.PropertyName == nameof(UserTypeVM.HasError)) { HasErrorUpdated(); } }; Reinitialize(); }
public ActionResult GetOrder(Guid Id, DateTime DateCreateStart, DateTime DateCreateEnd, string Status) { var checkCus = _customerService.GetCustomer(Id); if (checkCus == null) { return(NotFound("Not Found Customer")); } List <DateTimeVM> listDateTime = new List <DateTimeVM>(); //get orders var result = _orderService.GetOrders(o => o.CustomerId == Id && o.DateCreate >= DateCreateStart.AddDays(-1) && o.DateCreate <= DateCreateEnd.AddDays(1) && !o.Status.ToLower().Equals("done") && !o.Status.ToLower().Equals("cancel")); foreach (Order item in result) { DateTimeVM date = new DateTimeVM(); date.Date = item.DateCreate; OrderCM orderCM = item.Adapt <OrderCM>(); bool flag = false; foreach (DateTimeVM dates in listDateTime) { if (date.Date.ToString("dd/MM/yyyy").Equals(dates.Date.ToString("dd/MM/yyyy"))) { flag = true; dates.ListOrder.Add(orderCM); } } if (!flag) { date.ListOrder = new List <OrderCM>(); date.ListOrder.Add(orderCM); listDateTime.Add(date); } } return(Ok(listDateTime)); }
[Test, Ignore("TODO")] //TODO rewrite the test public void DateTimeVM() { Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("de-DE"); var vm = new DateTimeVM(); vm.EditValueProvider.String = "01.02.2010 08:22"; Assert.AreEqual(new DateTime(2010, 02, 01, 08, 22, 00), vm.Value); Assert.AreEqual("01.02.2010 08:22:00", vm.DisplayValueProvider.String); Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US"); vm = new DateTimeVM(); vm.EditValueProvider.String = "02/28/2010 08:22"; Assert.AreEqual(new DateTime(2010, 02, 28, 08, 22, 00), vm.Value); Assert.AreEqual("2/28/2010 8:22:00 AM", vm.DisplayValueProvider.String); }
public ResourceElementVM(ResourceElementOptions options, ModuleDef ownerModule, bool canDeserialize) { this.origOptions = options; this.canDeserialize = canDeserialize; this.booleanVM = new BooleanVM(a => HasErrorUpdated()); this.charVM = new CharVM(a => HasErrorUpdated()); this.byteVM = new ByteVM(a => HasErrorUpdated()); this.sbyteVM = new SByteVM(a => HasErrorUpdated()); this.int16VM = new Int16VM(a => HasErrorUpdated()); this.uint16VM = new UInt16VM(a => HasErrorUpdated()); this.int32VM = new Int32VM(a => HasErrorUpdated()); this.uint32VM = new UInt32VM(a => HasErrorUpdated()); this.int64VM = new Int64VM(a => HasErrorUpdated()); this.uint64VM = new UInt64VM(a => HasErrorUpdated()); this.singleVM = new SingleVM(a => HasErrorUpdated()); this.doubleVM = new DoubleVM(a => HasErrorUpdated()); this.decimalVM = new DecimalVM(a => HasErrorUpdated()); this.dateTimeVM = new DateTimeVM(a => HasErrorUpdated()); this.timeSpanVM = new TimeSpanVM(a => HasErrorUpdated()); this.userTypeVM = new UserTypeVM(ownerModule, canDeserialize); this.resourceElementTypeVM = new EnumListVM(resourceElementTypeList, (a, b) => OnResourceElementTypeChanged()); this.UserTypeVM.PropertyChanged += (s, e) => { if (e.PropertyName == "HasError") HasErrorUpdated(); }; Reinitialize(); }
public ResourceElementVM(ResourceElementOptions options, ModuleDef ownerModule, bool canDeserialize) { origOptions = options; this.canDeserialize = canDeserialize; BooleanVM = new BooleanVM(a => HasErrorUpdated()); CharVM = new CharVM(a => HasErrorUpdated()); ByteVM = new ByteVM(a => HasErrorUpdated()); SByteVM = new SByteVM(a => HasErrorUpdated()); Int16VM = new Int16VM(a => HasErrorUpdated()); UInt16VM = new UInt16VM(a => HasErrorUpdated()); Int32VM = new Int32VM(a => HasErrorUpdated()); UInt32VM = new UInt32VM(a => HasErrorUpdated()); Int64VM = new Int64VM(a => HasErrorUpdated()); UInt64VM = new UInt64VM(a => HasErrorUpdated()); SingleVM = new SingleVM(a => HasErrorUpdated()); DoubleVM = new DoubleVM(a => HasErrorUpdated()); DecimalVM = new DecimalVM(a => HasErrorUpdated()); DateTimeVM = new DateTimeVM(a => HasErrorUpdated()); TimeSpanVM = new TimeSpanVM(a => HasErrorUpdated()); UserTypeVM = new UserTypeVM(ownerModule, canDeserialize); ResourceElementTypeVM = new EnumListVM(resourceElementTypeList, (a, b) => OnResourceElementTypeChanged()); UserTypeVM.PropertyChanged += (s, e) => { if (e.PropertyName == nameof(UserTypeVM.HasError)) HasErrorUpdated(); }; Reinitialize(); }