コード例 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            GetMACAddress();
            var             seeter = client.Get("clientData/" + mca);
            autontification fdd    = seeter.ResultAs <autontification>();

            //macaddrss = fdd.MacAddress;
            joingdate = fdd.joingDate;
            mobileno  = fdd.MobileNo;
            //  expdate = fdd.trialend;

            DateTime        startDate = DateTime.Parse(DateTime.Now.Date.ToString());
            DateTime        expdate   = startDate.AddDays(365);
            autontification fd        = new autontification()
            {
                MobileNo   = mobileno,
                MacAddress = mca.ToString(),
                joingDate  = joingdate,
                trialend   = expdate.Date
                             //  trialend = expdate.Date
            };
            var seeter1 = client.Update("clientData/" + mca, fd);

            Program.expdate = expdate;
            MessageBox.Show("Your Subscription are start ");
        }
コード例 #2
0
        private void guna2Button1_Click(object sender, EventArgs e)
        {
            GetMACAddress();
            DateTime        startDate = DateTime.Parse(DateTime.Now.Date.ToString());
            DateTime        expdate   = startDate.AddDays(30);
            autontification fd        = new autontification()
            {
                MobileNo   = txtpartyfilter.Text,
                MacAddress = mca.ToString(),
                joingDate  = DateTime.Now.Date.ToString(),
                trialend   = expdate
            };
            var seeter = client.Set("clientData/" + mca, fd);
            //this.Close();
            // Application.Run(new Dashboard());


            var             seeter1 = client.Get("clientData/" + mca);
            autontification fdd     = seeter1.ResultAs <autontification>();

            Program.expdate = fdd.trialend;

            Dashboard ds = new Dashboard();

            ds.Show();
            this.Hide();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: RBadgujar-git/sales
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //client = new FireSharp.FirebaseClient(ifs);

            System.Net.NetworkInformation.NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
            String sMacAddress = string.Empty;

            foreach (NetworkInterface adapter in nics)
            {
                if (sMacAddress == String.Empty)// only return MAC Address from first card
                {
                    IPInterfaceProperties properties = adapter.GetIPProperties();
                    sMacAddress = adapter.GetPhysicalAddress().ToString();
                }
                //  Me
            }
            macaddress = sMacAddress;


            SqlConnection   con = new SqlConnection(Properties.Settings.Default.InventoryMgntConnectionString);
            IFirebaseConfig ifs = new FirebaseConfig()
            {
                AuthSecret = "BNccxyAb8l3p4CJZcrCwwB3N6KYw3o5N3fjkG8w8",
                BasePath   = "https://inventory-application-76653-default-rtdb.firebaseio.com/"
            };
            IFirebaseClient client;

            try
            {
                client = new FireSharp.FirebaseClient(ifs);



                var             seeter = client.Get("clientData/" + macaddress);
                autontification fdd    = seeter.ResultAs <autontification>();
                macaddrss = fdd.MacAddress;
                joingdate = fdd.joingDate;
                expdate   = fdd.trialend;
                //  startDate = DateTime.Parse(joingdate);
                // expdate = startDate.AddDays(30);
//MessageBox.Show("data " + expiryDate);
            }
            catch (Exception ew)
            {
                // MessageBox.Show("internet Connection not open"+ew);
            }

            if (macaddress == macaddrss)
            {
                con.Open();
                SqlCommand cmd      = new SqlCommand("Select count(*)  from PasswordCheek ", con);
                int        password = Convert.ToInt32(cmd.ExecuteScalar());
                con.Close();
                if (password == 0)
                {
                    Application.Run(new Dashboard());
                }
                else
                {
                    Application.Run(new LoginForm());
                }
            }
            else
            {
                Application.Run(new FirstLogin());
            }
        }