Esempio n. 1
0
 private void FaceToData(ref MembershipCard value)
 {
     value.CardCode = this.CardCodeID.Text;
     value.ValidDate = DateTime.Parse(this.ValidDateID.Text);
     value.Description = this.DescriptionID.Text;
     if (this.CardTypeID.SelectedValue.IsInt())
     {
         value.CardType =
             DependencyResolver.Resolver<ICategoryItemService>().FindById(int.Parse(this.CardTypeID.Text));
     }
     value.Company = this.CurrentCompany;
 }
Esempio n. 2
0
 public void CardTest()
 {
     IMembershipCardService cardService = WebCrm.Framework.DependencyResolver.Resolver<IMembershipCardService>();
     Model.MembershipCard card = new MembershipCard("001", "测试", System.DateTime.Now.AddYears(2), false);
     cardService.Save(card);
     Assert.IsNotNull(cardService.FindById(card.Id));
     card.Description = card.Description + "lsg";
     cardService.Update(card);
 }
Esempio n. 3
0
 private void DataToFace(MembershipCard value)
 {
     if (value == null)
     {
         return;
     }
     this.CardCodeID.Text = value.CardCode;
     this.ValidDateID.Text = value.ValidDate.ToShortDateString();
     this.DescriptionID.Text = value.Description;
     if (value.CardType != null)
     {
         this.CardTypeID.SelectedValue = value.CardType.Id.ToString();
     }
 }