Exemple #1
0
 private void Button1_Click(object sender, EventArgs e)
 {
     Repository.UserPointRepository userPointRepository = new Repository.UserPointRepository();
     if (rbAdd.Checked)
     {
         Repository.UserBargainRepository userBargainRepository = new Repository.UserBargainRepository();
         UserBargain userBargain = userBargainRepository.GetFirstAdmin();
         for (int i = 1; i <= numericUpDown1.Value; i++)
         {
             userPointRepository.Add(new UserPoint
             {
                 Date             = DateTime.Now,
                 IsVerify         = true,
                 UserBargain_Id_1 = _userid,
                 UserBargain_Id_2 = userBargain.Id
             });
             userPointRepository.Save2();
         }
     }
     else if (rbRemo.Checked)
     {
         for (int i = 1; i <= numericUpDown1.Value; i++)
         {
             userPointRepository.DeleteFirst(_userid);
             userPointRepository.Save2();
         }
     }
     MessageBox.Show("امتیاز ها با موفقیت ثبت شد");
     lblPointsTest.Text = $"مجموع امتیازات : {userPointRepository.CountPoint(_userid)*10} امتیاز ";
 }
Exemple #2
0
 private void FrmHistory_Load(object sender, EventArgs e)
 {
     try
     {
         Repository.UserBargainRepository userBargainRepository = new Repository.UserBargainRepository();
         UserBargain = userBargainRepository.GetUserWithMyID(_user_id);
         if (UserBargain != null)
         {
             Text = "سوابق : " + UserBargain.Name + " " + UserBargain.Family;
         }
     }
     catch { }
 }