Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        static public bool f_IsSerialValidForThisMachine(string _sKey)
        {
            long   decimalCpuId       = long.Parse(Lisans.f_GetCPUId(), System.Globalization.NumberStyles.HexNumber);
            string sDecimalCpuId      = decimalCpuId.ToString();
            string sSerialThisMachine = sDecimalCpuId.Substring(sDecimalCpuId.Length - 6);

            return(Lisans.f_GetSerialFromKey(_sKey).Equals(sSerialThisMachine));
        }
Ejemplo n.º 3
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();
            }
        }
Ejemplo n.º 4
0
 public UrunuKaydet()
 {
     InitializeComponent();
     tbKey.Text = Lisans.f_HashedKey();
 }
Ejemplo n.º 5
0
 static public bool f_IsSerialValid(string _sKey, string _sSerial)
 {
     return(Lisans.f_GetSerialFromKey(_sKey).Equals(_sSerial));
 }