Esempio n. 1
0
        // 序列化
        public Byte[] Serialize()
        {
            SAVE s = saveData;

            BinaryFormatter formatter = new BinaryFormatter();
            MemoryStream    memstream = new MemoryStream();

            formatter.Serialize(memstream, s);
            byte[] data = memstream.ToArray();
            memstream.Dispose();
            return(data);
        }
Esempio n. 2
0
        public static void AssociateOpcodes()
        {
            instructions[0] = new NOP();
            instructions[1] = new PRNT();

            instructions[16] = new PUSH();
            instructions[17] = new POP();
            instructions[18] = new SAVE();
            instructions[19] = new CPY();
            instructions[20] = new RNDM();
            instructions[21] = new EMPTY();

            instructions[128] = new ADD();
            instructions[129] = new SUB();
            instructions[130] = new MUL();
            instructions[131] = new DIV();

            instructions[132] = new SUB2();
            instructions[133] = new DIV2();

            instructions[134] = new NEG();
            instructions[135] = new ABS();

            instructions[144] = new INC();
            instructions[145] = new DEC();

            instructions[64] = new JMP();
            instructions[65] = new JGZ();
            instructions[66] = new JLZ();
            instructions[67] = new JEZ();
            instructions[68] = new JNZ();
            instructions[69] = new CALL();
            instructions[70] = new RET();
            instructions[71] = new LDLOC();
            instructions[72] = new STLOC();
            instructions[73] = new LDARG();
            instructions[74] = new STARG();

            instructions[0b10100100] = new CMP();
 public override bool save(SAVE save)
 {
     throw new NotImplementedException();
 }
Esempio n. 4
0
        private void cmdProtokolPrint_Click(object sender, EventArgs e)
        {
            if (!CheckForEnd()) return;

            SAVE_ONLY = SAVE.PRINT_PROTOKOL;

            this.CANCEL = false;

            Close();
        }
Esempio n. 5
0
        private void cmdPrintOrder_Click(object sender, EventArgs e)
        {
            if (!CheckForEnd()) return;

            SAVE_ONLY = SAVE.PRINT_ORDER;

            CANCEL = false;

            Close();
        }
Esempio n. 6
0
        private void cmdPrintInfo_Click(object sender, EventArgs e)
        {
            if (!CheckForEnd()) return;

            SAVE_ONLY = SAVE.INFO;

            Transakcje transakcja = (Transakcje)this;

            Drukuj.PrintInfo(ref transakcja);
        }
Esempio n. 7
0
        private void cmdKoniec_Click(object sender, EventArgs e)
        {
            if (!CheckForEnd()) return;

            //if (PRODUKTY.Count == 0 && USLUGI.Count == 0)
            //{ Message.ErrorMessage("Lista towarów oraz usług jest pusta"); return; }

            SAVE_ONLY = SAVE.PRINT;

            CANCEL = false;

            Close();
        }
Esempio n. 8
0
        private void cmdKoniecSave_Click(object sender, EventArgs e)
        {
            if (!CheckForEnd()) return;

            SAVE_ONLY = SAVE.SAVE;

            CANCEL = false;

            Close();
        }
 public abstract bool save(SAVE save);
        public override bool save(SAVE save)
        {
            try
            {
                switch (save)
                {
                    case SAVE.INSERT:
                        this.sqlCommand = new MySqlCommand(DataBaseTrans.prcAddNotas, this.conn);
                        this.sqlCommand.Parameters.AddWithValue("@idDiscipl", this.idDisciplina);
                        this.sqlCommand.Parameters.AddWithValue("@idaluno", this.idAluno);
                        break;
                    case SAVE.UPDATE:
                        this.sqlCommand = new MySqlCommand(DataBaseTrans.prcUpdtNotas, this.conn);
                        this.sqlCommand.Parameters.AddWithValue("@IdNota", this.idNota);
                        break;
                }

                this.sqlCommand.Parameters.AddWithValue("@ntProva", this.notaProva);
                this.sqlCommand.Parameters.AddWithValue("@sem", this.semestre);
                this.sqlCommand.Parameters.AddWithValue("@bim", this.bimestre);
                this.sqlCommand.Parameters.AddWithValue("@ntTrab", this.notaProva);
                this.sqlCommand.Parameters.AddWithValue("@falta", this.faltas);

                this.sqlCommand.CommandType = CommandType.StoredProcedure;
                this.sqlCommand.ExecuteNonQuery();
                this.conn.Close();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.ToString());
            }

            return true;
        }