Example #1
0
        public int f_RetrieveAndInsert()
        {
            // Uygulama kayıt ettirilmişmi?
            string sAnahtar, sSeriNo;

            Lisans.f_GetLicenceSerialFromReg(out sAnahtar, out sSeriNo);
            if (!Lisans.f_IsSerialValid(sAnahtar, sSeriNo) && !Lisans.f_IsSerialValidForThisMachine(sAnahtar))
            {
                throw new Exception("Uygulamayı kayıt ettirmeden cihazdan bilgi çekemezsiniz!!!!");
            }


            int    iEtkilenen  = 0;
            string cihazSeriNo = M_PortControl.f_GetSerial();

            using (DAL dal = new DAL())
            {
                DataRetrieve dataRetrieve = new DataRetrieve(cihazSeriNo, sAnahtar, sSeriNo);
                iEtkilenen = dataRetrieve.f_Insert();
                if (iEtkilenen > 0)
                {
                    iEtkilenen += dal.f_InsertAll(dataRetrieve.M_DataRetrieve_ID, M_Alarms, M_Logs, M_InstantValues, M_SettedValues);
                }
            }
            return(iEtkilenen);
        }
Example #2
0
        private void btnKaydet_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(tbSeriNo.Text))
            {
                MessageBox.Show("Seri numarasını girdiğinizden emin olunuz.", "Lisanslama", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (!Lisans.f_IsSerialValid(tbKey.Text, tbSeriNo.Text))
            {
                MessageBox.Show("Seri numarasını doğru girdiğinizden emin olunuz!", "Lisanslama", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (Lisans.f_SetLicenceSerial(tbSeriNo.Text))
            {
                VeriCekGoster.bAktivasyonOk = true;
                this.Close();
            }
        }