Example #1
0
		public void UpdateCell (QuizVoucher quizVoucher)
		{
			this.Voucher = quizVoucher;
			this.lblCode.Text = quizVoucher.Code;
			
			SetNeedsDisplay ();
		}
Example #2
0
		public static void Update (QuizVoucher voucher)
		{
			voucher.ModifyAt = DateTime.Now;
			if (voucher.Id == 0) {
				voucher.CreateAt = DateTime.Now;
				db.Insert (voucher);
			} else {
				db.Update (voucher);
			}
		}
Example #3
0
		private void Initialize (QuizVoucher quizVoucher)
		{
			this.Voucher = quizVoucher;
			
			lblCode = new UILabel (new RectangleF (10, 14, 127, 21)){
				Font = UIFont.BoldSystemFontOfSize (18),
				TextColor = UIColor.White,
				BackgroundColor = UIColor.Clear,
				AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleTopMargin,
			};
			
			UpdateCell (this.Voucher);
			ContentView.Add (lblCode);
		}
Example #4
0
		private void VoucherActivate (QuizVoucher voucher)
		{
			if (Busy)
				return;
			
			if (ServiceAgent.Execute (_serviceAgent.ServiceClient.ActivateVoucherAsync, Util.DeviceUid, voucher.QuizId, voucher.Code, voucher)) {
				Busy = true;
			}
		}
Example #5
0
		private QuizVoucher GetVoucher ()
		{
			if (QuizVoucherRepository.GetVoucher4Quiz (_quiz.Id) == null) {
				// Get from Service
				string code = Util.RandomString(5);
				var voucher = new QuizVoucher (){ Code = code, QuizId=_quiz.Id};
				QuizVoucherRepository.Update (voucher);
				return voucher;
			}
			return null;
		}
Example #6
0
		public VoucherActivateCell (UITableViewCellStyle style, NSString ident, QuizVoucher voucher) : base (style, ident, voucher)
		{
			this.Initialize ();
		}
Example #7
0
		public VoucherActivateCell (NSString ident, QuizVoucher voucher) : this(UITableViewCellStyle.Default, ident, voucher)
		{
			
		}
Example #8
0
		public VoucherCellBase (UITableViewCellStyle style, NSString ident, QuizVoucher quizVoucher) : base (style, ident)
		{
			Initialize (quizVoucher);
		}
Example #9
0
		public VoucherElement (QuizVoucher video) : base (null)
		{
			this.voucher = video;
		}