Esempio n. 1
0
        public int excuteAutoUpdate(int id, string address)
        {
            TrackingWebHYIPDatabase     trackwebdata = new TrackingWebHYIPDatabase();
            BUS_TrackingWebHYIPDatabase bussdata     = new BUS_TrackingWebHYIPDatabase();
            GetDataWeb             getdt             = new GetDataWeb();
            Tuple <string, string> info = getdt.GetDepositAndWithdraw(address);

            if (info.Item1 != "")
            {
                string timenow = DateTime.Now.ToString("MM-dd-yyyy HH:mm:ss.fff");
                trackwebdata.MaWeb    = id;
                trackwebdata.Deposit  = float.Parse(info.Item1.ToString(), CultureInfo.InvariantCulture.NumberFormat);
                trackwebdata.WithDraw = float.Parse(info.Item2.ToString(), CultureInfo.InvariantCulture.NumberFormat);
                trackwebdata.Today    = timenow;

                //insert TrackingWebHYIPDatabase
                int result = bussdata.InsertTrackingWebHYIPDatabase(trackwebdata);
                return(result);
            }
            return(-1);
        }
Esempio n. 2
0
        private void dataGridView2_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            if (dataGridView2.Columns[e.ColumnIndex].Name != "")
            {
                DataGridViewRow selectedRow = dataGridView2.Rows[e.RowIndex];
                string          Name        = selectedRow.Cells["name"].Value.ToString();
                if (Name != "")
                {
                    bool checkname = CheckNameExits(Name, dataGridView2);
                    if (checkname)
                    {
                        MessageBox.Show("Name Exits");
                        selectedRow.Cells["name"].Value = "";
                    }
                    else
                    {
                        //insert vo TrackingWebHYIP
                        BUS_TrackingWebHYIP         buss     = new BUS_TrackingWebHYIP();
                        BUS_TrackingWebHYIPDatabase bussdata = new BUS_TrackingWebHYIPDatabase();

                        TrackingWebHYIP         tracweb      = new TrackingWebHYIP();
                        TrackingWebHYIPDatabase trackwebdata = new TrackingWebHYIPDatabase();
                        tracweb.Addrress = Name;
                        GetDataWeb             getdt = new GetDataWeb();
                        Tuple <string, string> info  = getdt.GetDepositAndWithdraw(Name);
                        if (info.Item1.ToString() == "cloudfare")
                        {
                            DialogResult result = MessageBox.Show("This webste use Cloudfare . Add manual");
                            if (result == DialogResult.OK)
                            {
                                AddWebTracking frm = new AddWebTracking(this);
                                frm.ShowDialog();
                            }
                        }
                        else if (info.Item1.ToString() == "Something Wrong" || info.Item1.ToString() == "" || info.Item2.ToString() == "")
                        {
                            DialogResult result = MessageBox.Show("Something wrong.Add manual");
                            if (result == DialogResult.OK)
                            {
                                AddWebTracking frm = new AddWebTracking(this);
                                frm.ShowDialog();
                            }
                        }
                        else
                        {
                            //Id web vua add vao co so du lieu
                            tracweb.GetInformationAuto = 1;
                            tracweb.Good = 1;
                            int ID = buss.InsertTrackingWebHYIP(tracweb);
                            //lay dep va with trang web


                            string timenow = DateTime.Now.ToString("MM-dd-yyyy HH:mm:ss.fff");
                            trackwebdata.MaWeb    = ID;
                            trackwebdata.Deposit  = float.Parse(info.Item1.ToString(), CultureInfo.InvariantCulture.NumberFormat);
                            trackwebdata.WithDraw = float.Parse(info.Item2.ToString(), CultureInfo.InvariantCulture.NumberFormat);
                            trackwebdata.Today    = timenow;

                            //insert TrackingWebHYIPDatabase
                            int result = bussdata.InsertTrackingWebHYIPDatabase(trackwebdata);
                            if (result != 0)
                            {
                                LoadDataTracking();
                            }
                        }
                    }
                }
            }
        }