Exemple #1
0
 private void btnOK_Click(object sender, System.EventArgs e)
 {
     try
     {
         string serial = this.txtSerial1.Text + this.txtSerial2.Text + this.txtSerial3.Text +
                         this.txtSerial4.Text + this.txtSerial5.Text;
         if (serial == RegistrationClass.GetEncryptedKeyFull())
         {
             int roomsCount = RegistrationClass.GetRoomsCount();
             RegistrationClass.StoreKeyToRegistry(serial);
             RegistrationClass.StoreKeyToRegistry("Vlera2", roomsCount.ToString().Length.ToString());
             MessageBox.Show("Rregjistrimi i programit u krye me sukses per " + roomsCount + " dhoma" +
                             Environment.NewLine + "Ju lutemi hapni dhe mbyllni programin perseri qe ndryshimet te "
                             + "te pasqyrohen ne program.", "Rregjistrimi", MessageBoxButtons.OK,
                             MessageBoxIcon.Information);
             this.Close();
         }
         else
         {
             MessageBox.Show("Numri serial qe ju futet nuk eshte i sakte. Ju lutemi provoni perseri ose merrni numrin serial nga VisionInfoSolution", "Rregjistrimi", MessageBoxButtons.OK,
                             MessageBoxIcon.Information);
         }
     }
     catch (Exception ex)
     {
         return;
     }
 }
Exemple #2
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            string serial = this.txtSerial1.Text + this.txtSerial2.Text + this.txtSerial3.Text + this.txtSerial4.Text;

            if (serial == RegistrationClass.GetEncryptedKeyFull())
            {
                RegistrationClass.StoreKeyToRegistry(serial);
                MessageBox.Show("Rregjistrimi i programit u krye me sukses", "Rregjistrimi i programit", MessageBoxButtons.OK, MessageBoxIcon.Information);
                regSakte = true;
            }
            else
            {
                MessageBox.Show("Numri qe vendoset nuk eshte i sakte. Ju lutemi kontaktoni me VisionInfoSolution!", "Rregjistrimi i programit", MessageBoxButtons.OK, MessageBoxIcon.Error);
                regSakte = false;
            }
            this.Close();
        }
 private void btnOK_Click(object sender, System.EventArgs e)
 {
     if (this.numNrDhomash.Text == "")
     {
         this.error1.SetError(this.numNrDhomash, "Fusha e numrit te dhomave nuk mund te lihet bosh");
         return;
     }
     if (!Regex.IsMatch(this.numNrDhomash.Text, "^-?[0-9]*(\\,)?[0-9]+$"))
     {
         this.error1.SetError(this.numNrDhomash, "Vlera duhet te jete numer");
         return;
     }
     if (Convert.ToInt32(this.numNrDhomash.Text) < 0)
     {
         this.error1.SetError(this.numNrDhomash, "Vlera duhet te jete me e madhe se zero");
         return;
     }
     this.error1.SetError(this.numNrDhomash, "");
     if (!this.firstTimeOpen)
     {
         if (this.numNrDhomash.Text == this.initialValue.ToString())
         {
             // Ne kete rast nuk bejme modifikim sepse numrat jane te njejte
             this.Close();
             return;
         }
         RegistrationClass.EditRegistryKey(this.initialValue, Convert.ToInt32(this.numNrDhomash.Text));
         MessageBox.Show("Numri i dhomave qe mban hoteli u ndryshua." + Environment.NewLine +
                         "Per cdo problem kontaktoni me VisionInfoSolution", "Ndryshimi i dhomave",
                         MessageBoxButtons.OK, MessageBoxIcon.Information);
         this.Close();
         return;
     }
     RegistrationClass.StoreKeyToRegistry(Convert.ToInt32(this.numNrDhomash.Text));
     MessageBox.Show("Numri i dhomave qe mban hoteli u ruajt", "Ndryshimi i dhomave",
                     MessageBoxButtons.OK, MessageBoxIcon.Information);
     this.Close();
 }