private void button1_Click(object sender, EventArgs e) { if (textBox1.Text == "") { return; } NhomUID temp = null;; if (!textBox1.Text.Contains("https://www.facebook.com")) { if (Utilities.CheckNumberEnterKey(textBox1.Text)) { MessageBox.Show("Vui lòng kiễm tra UID", "Thông Báo"); return; } (new Waiting(() => temp = Facebook.ConvertUidToNhom(textBox1.Text))).ShowDialog(); } else { (new Waiting(() => temp = Facebook.ConvertUrdToNhom(textBox1.Text))).ShowDialog(); } if (temp == null) { MessageBox.Show("Không lấy được UID", "Thông Báo"); return; } List <NhomUID> NhomUIDs = SQLDatabase.LoadNhomUID(string.Format("select * from NhomUID where uid='{0}'", temp.UID)); SQLDatabase.AddNhomUID(temp); /*goi hàm kiễm tra lại trạng thái token có vươc gioi han soa chưa?*/ this.DialogResult = DialogResult.OK; this.Close(); }
private void SaveGroup() { for (int i = 0; i < 2; i++) { /*Group*/ foreach (DataGridViewRow row in gridGroup.Rows) { DataGridViewCheckBoxCell chk = (DataGridViewCheckBoxCell)row.Cells["checkNhom"]; if (chk.Value != null && (Boolean)chk.Value == true) { string id = row.Cells["idGroup"].Value.ToString(); string name = row.Cells["nameGroup"].Value.ToString(); List <NhomUID> nhomUIDs = SQLDatabase.LoadNhomUID(string.Format("select * from NhomUID where ParentId in (select id from NhomUID where Name='admin') and UID='{0}'", id)); if (nhomUIDs.Count == 0) { NhomUID nhomUIDCha = SQLDatabase.LoadNhomUID("select * from NhomUID where name='admin'").FirstOrDefault(); SQLDatabase.AddNhomUID(new NhomUID() { UID = id, Name = name, URD = "https://www.facebook.com/", ParentId = nhomUIDCha.id, IsActi = true, IsLoai = 2 }); gridGroup.Rows.Remove(row); } } } } }