Exemple #1
0
        public int InsertWEBHYIP(WEBHYIPMODEL web)
        {
            int result = 0;

            try
            {
                result = conector.InsertTableWEBHYIP(web);
                return(result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #2
0
 /// <summary>
 /// ham them du lieu vao bang WEBHYIP
 /// </summary>
 /// <param name="table">ten bang</param>
 /// <param name="web">doi tuong web </param>
 /// <returns> vi tri dong vua them thanh cong</returns>
 public int InsertTableWEBHYIP(WEBHYIPMODEL web)
 {
     try
     {
         string sql = " insert into WEBHYIP values('" + web.Name + "'," + web.Deposit + ",'" + web.DateJoin + "' ," + web.Status + "," + web.Monitor + "," + web.RCB + " ) SELECT SCOPE_IDENTITY()";
         cmd            = new SqlCommand(sql);
         cmd.Connection = conn;
         this.openConnection();
         int result = Convert.ToInt32(cmd.ExecuteScalar());
         this.closeConnection();
         return(result);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (validateTextbox_dep && validateTextbox_rcb && textBox_name.Text != "")
            {
                errorProvider1.Clear();
                //model web
                WEBHYIPMODEL web = new WEBHYIPMODEL();
                web.Name     = textBox_name.Text;
                web.Deposit  = Convert.ToInt32(textBox_dep.Text);
                web.DateJoin = dateTimePicker_timejoin.Value.ToString("MM-dd-yyyy HH:mm:ss.fff");
                web.Status   = (int)comboBox_status.SelectedValue;
                web.Monitor  = (int)comboBox_monitor.SelectedValue;
                web.RCB      = float.Parse(textBox_rcb.Text);
                //call connector
                BUS_WEBHYIP buss   = new BUS_WEBHYIP();
                int         result = buss.InsertWEBHYIP(web);
                if (result != 0)
                {
                    //truy van lay ra id web vua add vao
                    //result chinh la ID cua web moi vua tao
                    //  UpdateWebChart(result, web.Name, web.DateJoin);
                    MessageBox.Show("Success . Please add this web on tracking databse !");

                    //TrackingHYIPDatabase frm = new TrackingHYIPDatabase();
                    //frm.ShowDialog();


                    p_form.LoadData("PAYING");
                    this.Close();
                }
            }
            else
            {
                MessageBox.Show("Check again data input ");
            }
        }