Example #1
0
 void btnThemTaiKhoan_Click(object sender, EventArgs e)
 {
     try
     {
         Dictionary <string, object> dicParam = new Dictionary <string, object>();
         AddAccount addAccount = new AddAccount();
         addAccount.ShowDialog();
         dicParam = addAccount.DicParams;
         if (dicParam != null &&
             dicParam.ContainsKey(M_AccountConst.Account) &&
             dicParam.ContainsKey(M_AccountConst.Password) &&
             dicParam.ContainsKey(M_AccountConst.CookieFB) &&
             dicParam.ContainsKey(M_AccountConst.FaceBookID))
         {
             DataTable dtAccount = dbProvider.GetData("SELECT * FROM " + M_AccountConst.TableName + " WHERE 1=2", M_AccountConst.TableName);
             if (dtAccount != null && dtAccount.Columns.Count > 0)
             {
                 DataRow rowNewAccount = dtAccount.NewRow();
                 dtAccount.Rows.Add(rowNewAccount);
                 rowNewAccount[M_AccountConst.Account]    = dicParam[M_AccountConst.Account];
                 rowNewAccount[M_AccountConst.CookieFB]   = dicParam[M_AccountConst.CookieFB];
                 rowNewAccount[M_AccountConst.FaceBookID] = dicParam[M_AccountConst.FaceBookID];
                 rowNewAccount[M_AccountConst.PackageXid] = txtPackNo.Text.Trim();
                 rowNewAccount[M_AccountConst.Password]   = dicParam[M_AccountConst.Password];
                 if (dbProvider.Execute(dtAccount))
                 {
                     getAccountOfPack(txtPackNo.Text.Trim());
                 }
             }
         }
     }
     catch (Exception ex)
     {
     }
 }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            //Add an account
            AccountOperation addMAccount = new AddAccount();
            addMAccount.SetDataTable(originalTable);
            addMAccount.ShowDialog();

            FillTheDatagrid();
        }
Example #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            //Add an account
            AccountOperation addMAccount = new AddAccount();

            addMAccount.SetDataTable(originalTable);
            addMAccount.ShowDialog();

            FillTheDatagrid();
        }
Example #4
0
 private void gridData_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     //return;
     try
     {
         Poker pokerUpdate = gridData.Rows[gridData.CurrentCell.RowIndex].DataBoundItem as Poker;
         Dictionary <string, object> dicParam = new Dictionary <string, object>();
         AddAccount addAccount = new AddAccount();
         addAccount.Account = pokerUpdate.RowData[M_AccountConst.Account].ToString();
         //addAccount.Password = pokerUpdate.RowData[M_AccountConst.Password].ToString();
         addAccount.ShowDialog();
         dicParam = addAccount.DicParams;
         if (dicParam != null &&
             dicParam.ContainsKey(M_AccountConst.Account) &&
             dicParam.ContainsKey(M_AccountConst.Password) &&
             dicParam.ContainsKey(M_AccountConst.CookieFB) &&
             dicParam.ContainsKey(M_AccountConst.FaceBookID))
         {
             DataTable dtAccount = dbProvider.GetData("SELECT * FROM " + M_AccountConst.TableName + " WHERE Pid = '" + pokerUpdate.RowData[M_AccountConst.Pid].ToString() + "'", M_AccountConst.TableName);
             if (dtAccount != null && dtAccount.Rows.Count > 0)
             {
                 DataRow rowAccount = dtAccount.Rows[0];
                 rowAccount[M_AccountConst.Account]    = dicParam[M_AccountConst.Account];
                 rowAccount[M_AccountConst.CookieFB]   = dicParam[M_AccountConst.CookieFB];
                 rowAccount[M_AccountConst.FaceBookID] = dicParam[M_AccountConst.FaceBookID];
                 rowAccount[M_AccountConst.PackageXid] = pokerUpdate.RowData[M_AccountConst.PackageXid];
                 rowAccount[M_AccountConst.Password]   = dicParam[M_AccountConst.Password];
                 if (dbProvider.Execute(dtAccount))
                 {
                     dicPoker.Remove((Int64)pokerUpdate.RowData[M_AccountConst.Pid]);
                     getAccountOfPack(txtPackNo.Text.Trim());
                 }
             }
         }
     }
     catch (Exception ex)
     {
     }
 }