public void Delete(int Id, out string Message, out System.Drawing.Color Color)
        {
            Object.Position position = new Object.Position();
            position.Id = Id;

            int ResultNumber = crud.Delete(position);

            message.Delete(ResultNumber, out Message, out Color);
        }
        public void Create(string Position, decimal Salary, out string Message, out System.Drawing.Color Color)
        {
            Object.Position position = new Object.Position();
            position.Name   = Position;
            position.Salary = Salary;

            int ResultNumber = crud.Create(position);

            message.Create(ResultNumber, out Message, out Color);
        }
Exemple #3
0
        public DataTable ReadWithSelectedPositionId(int Id)
        {
            //Gets the selected subject id value from gridview and displays teacher full name gridview
            DataTable table = new DataTable();

            table.Columns.Add("FullName");

            Object.Position position = new Object.Position();
            position.Id = Id;

            return(crud.ReadWithSelectedPositionId(table, position));
        }
Exemple #4
0
 public Player(string usr, string usrlower, string passwd)
 {
     Identity               = new Identity();
     Identity.Username      = usr;
     Identity.Password      = passwd;
     Identity.UsernameLower = usrlower;
     State       = new State();
     State.Stats = new Stats();
     Inventory   = new Inventory();
     Bank        = new Bank();
     Spells      = new Spells();
     Position    = new Object.Position();
 }
        public void Update(int Id, string Position, decimal Salary, out string Message, out System.Drawing.Color Color)
        {
            Position = Position.Trim();

            Object.Position position = new Object.Position();

            position.Id     = Id;
            position.Name   = Char.ToUpper(Position[0]) + Position.Substring(1);
            position.Salary = Salary;

            int ResultNumber = crud.Update(position);

            message.Update(ResultNumber, out Message, out Color);
        }
Exemple #6
0
        public void parseFace(ref Object.Position player)
        {
            var face = player.Face;

            if (face == 0)
            {
                player.Y--;
            }
            if (face == 1)
            {
                player.X++;
                player.Y--;
            }
            if (face == 2)
            {
                player.X++;
            }
            if (face == 3)
            {
                player.X++;
                player.Y++;
            }
            if (face == 4)
            {
                player.Y++;
            }
            if (face == 5)
            {
                player.X--;
                player.Y++;
            }
            if (face == 6)
            {
                player.X--;
            }
            if (face == 7)
            {
                player.X--;
                player.Y--;
            }
        }
Exemple #7
0
        public int Delete(Object.Position position)
        {
            using (SqlConnection con = new SqlConnection(SharedMethods.getConnectionString()))
            {
                SqlCommand cmd = new SqlCommand("spDeletePosition_tblPosition", con);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@Id", position.Id);

                SqlParameter Result = new SqlParameter("@ResultNumber", DbType.Int32);
                Result.Direction = ParameterDirection.Output;

                cmd.Parameters.Add(Result);

                con.Open();
                cmd.ExecuteNonQuery();
                con.Close();

                return((int)Result.Value);
            }
        }
Exemple #8
0
        public DataTable ReadWithSelectedPositionId(DataTable table, Object.Position position)
        {
            using (SqlConnection con = new SqlConnection(SharedMethods.getConnectionString()))
            {
                SqlCommand cmd = new SqlCommand("Select FullName From vwTeacherInfo_tblTeacherInfo Where PositionId = @PositionId", con);
                cmd.CommandType = CommandType.Text;

                cmd.Parameters.AddWithValue("@PositionId", position.Id);
                con.Open();
                using (SqlDataReader rdr = cmd.ExecuteReader())
                {
                    while (rdr.Read())
                    {
                        DataRow row = table.NewRow();

                        row["FullName"] = rdr["FullName"];

                        table.Rows.Add(row);
                    }
                    return(table);
                }
            }
        }