예제 #1
0
 private void btnAddKey_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(this.txtLicense.Text.Trim()))
     {
         DLLLicensePS.Reponse res = DLLLicensePS.DECRYPT.CheckLisences(this.TrungTam.ID, string.Empty, this.txtLicense.Text.Trim(), this.NgayServer.Date.ToString("dd/MM/yyyy"), DateTime.Now.Date.ToString("dd/MM/yyyy"));
         if (res != null)
         {
             if (res.TimeRemind > 0)
             {
                 var submit = BioNet_Bus.CapNhatLisence(this.txtLicense.Text.Trim());
                 if (submit.Result)
                 {
                     this.DialogResult = DialogResult.OK;
                     this.Close();
                 }
                 else
                 {
                     XtraMessageBox.Show(submit.StringError, "BioNet sàng lọc sơ sinh", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 }
             }
             else
             {
                 if (string.IsNullOrEmpty(res.ResultString))
                 {
                     XtraMessageBox.Show("Key này đã hết hạn, vui lòng thử key khác!", "BioNet sàng lọc sơ sinh", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 }
                 else
                 {
                     XtraMessageBox.Show(res.ResultString, "BioNet sàng lọc sơ sinh", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 }
             }
         }
     }
 }
예제 #2
0
        private void LoadCheckLicense()
        {
            DLLLicensePS.Reponse res = DLLLicensePS.DECRYPT.CheckLisences(TrungTam.ID, string.Empty, TrungTam.LicenseKey, this.NgayServer.Date.ToString("dd/MM/yyyy"), DateTime.Now.Date.ToString("dd/MM/yyy"));
            switch (res.KindOfLisence)
            {
            case 1:
                this.txtBanQuyen.Text = "Dùng thử";
                break;

            case 2:
                this.txtBanQuyen.Text = "Đã chứng thực";
                break;

            case 3:
                this.txtBanQuyen.Text = "Miễn phí";
                break;

            default:
                this.txtBanQuyen.Text = "Không hợp lệ";
                break;
            }

            this.txtThoiGian.Text = string.Format(this.str, res.TimeRemind);
        }