Exemple #1
0
		public void UpdateCell (QuizVoucher quizVoucher)
		{
			this.Voucher = quizVoucher;
			this.lblCode.Text = quizVoucher.Code;
			
			SetNeedsDisplay ();
		}
Exemple #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);
			}
		}
Exemple #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);
		}
		private void VoucherActivate (QuizVoucher voucher)
		{
			if (Busy)
				return;
			
			if (ServiceAgent.Execute (_serviceAgent.ServiceClient.ActivateVoucherAsync, Util.DeviceUid, voucher.QuizId, voucher.Code, voucher)) {
				Busy = true;
			}
		}
Exemple #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;
		}
Exemple #6
0
		public VoucherActivateCell (UITableViewCellStyle style, NSString ident, QuizVoucher voucher) : base (style, ident, voucher)
		{
			this.Initialize ();
		}
Exemple #7
0
		public VoucherActivateCell (NSString ident, QuizVoucher voucher) : this(UITableViewCellStyle.Default, ident, voucher)
		{
			
		}
Exemple #8
0
		public VoucherCellBase (UITableViewCellStyle style, NSString ident, QuizVoucher quizVoucher) : base (style, ident)
		{
			Initialize (quizVoucher);
		}
Exemple #9
0
		public VoucherElement (QuizVoucher video) : base (null)
		{
			this.voucher = video;
		}