public void UpdateCell (QuizVoucher quizVoucher) { this.Voucher = quizVoucher; this.lblCode.Text = quizVoucher.Code; SetNeedsDisplay (); }
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); } }
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; } }
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; }
public VoucherActivateCell (UITableViewCellStyle style, NSString ident, QuizVoucher voucher) : base (style, ident, voucher) { this.Initialize (); }
public VoucherActivateCell (NSString ident, QuizVoucher voucher) : this(UITableViewCellStyle.Default, ident, voucher) { }
public VoucherCellBase (UITableViewCellStyle style, NSString ident, QuizVoucher quizVoucher) : base (style, ident) { Initialize (quizVoucher); }
public VoucherElement (QuizVoucher video) : base (null) { this.voucher = video; }