Ejemplo n.º 1
0
 private string[] CreateNewRaid()
 {
     if (CheckForOpenRaid() == false)
     {
         using (FrmInput frminput = new FrmInput())
         {
             if (frminput.ShowDialog() == DialogResult.OK)
             {
                 SqlCommand cmd = new SqlCommand("usp_CreateNewRaid", cn);
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.Parameters.AddWithValue("@Description", frminput.Description);
                 int x = cmd.ExecuteNonQuery();
                 if (x == 1)
                 {
                     return(GetOpenRaid());
                 }
                 else
                 {
                     MessageBox.Show("No Raid was created.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                 }
             }
         }
         return(null);
     }
     else
     {
         MessageBox.Show("There is a Raid already open.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         return(null);
     }
 }
Ejemplo n.º 2
0
        private void LoadDKP(List <Character> dump, Int16 award, int SchedID, bool isAttend)
        {
            string strDesc = "Attendance DKP";

            if (isAttend == false)
            {
                using (FrmInput frmX = new FrmInput())
                {
                    frmX.FrmText   = "DKP Award";
                    frmX.LabelText = "Enter a description of the DKP Award: (50 character max)";
                    if (frmX.ShowDialog() == DialogResult.OK)
                    {
                        strDesc = frmX.Description;
                    }
                }
                Cursor.Current = Cursors.WaitCursor;
                foreach (Character c in dump)
                {
                    if (c.StatusName == "Guest")
                    {
                        continue;
                    }
                    SqlCommand cmd = new SqlCommand("usp_DKPAward", cn);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Name", c.Name);
                    cmd.Parameters.AddWithValue("@RaidId", RaidId);
                    cmd.Parameters.AddWithValue("@Amount", award);
                    cmd.Parameters.AddWithValue("@Description", strDesc);
                    cmd.ExecuteNonQuery();
                    cmd.Dispose();
                }
            }
            else
            {
                foreach (Character c in dump)
                {
                    if (c.StatusName == "Alt" || c.StatusName == "Guest")
                    {
                        continue;
                    }
                    SqlCommand cmd = new SqlCommand("usp_DKPAttendanceAward", cn);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Name", c.Name);
                    cmd.Parameters.AddWithValue("@RaidId", RaidId);
                    cmd.Parameters.AddWithValue("@Amount", award);
                    cmd.Parameters.AddWithValue("@Description", strDesc);
                    cmd.Parameters.AddWithValue("@SchedId", SchedID);
                    cmd.ExecuteNonQuery();
                    cmd.Dispose();
                }
            }
            Cursor.Current = Cursors.Default;
        }