Example #1
0
 public void Execute(IList <string> parameters)
 {
     foreach (Information info in Informations.GetInformations())
     {
         Console.WriteLine(info.DisplayName);
     }
 }
Example #2
0
    public Informations GetInfo()
    {
        Informations info = new Informations();

        info.sprite = GetComponent <SpriteRenderer>().sprite;

        switch (Level)
        {
        case Level.Level1:
            info.Gold     = goldLevel1;
            info.Food     = foodLevel1;
            info.Building = buildingLevel1;
            break;

        case Level.Level2:
            info.Gold     = goldLevel2;
            info.Food     = foodLevel2;
            info.Building = buildingLevel2;
            break;

        case Level.Level3:
            info.Gold     = goldLevel3;
            info.Food     = foodLevel3;
            info.Building = buildingLevel3;
            break;
        }
        info.Soldiers  = soldiers;
        info.happiness = happiness;

        return(info);
    }
Example #3
0
        public CadFunc(Informations infor)
        {
            this.InitializeComponent();
            mode = 1;
            txtWindowTitle.Text = "Alterar Funcionário";

            info.cod_func = infor.cod_func;
            txtNome.Text = infor.nome_func;
            txtCPF.Text = infor.CPF_func;
            txtTel.Text = infor.telRes_func;
            txtCel.Text = infor.cel_func;
            txtPorc.Text = infor.porc_func.ToString();
            txtDataAdm.Text = infor.dataAdm_func.ToString();
            txtCargo.Text = infor.cargo_func;
            if(infor.situacao_func == "Ativo")
            {
                cbSitua.SelectedIndex = 0;
            }
            else if(infor.situacao_func == "Afastado")
            {
                cbSitua.SelectedIndex = 1;
            }
            else
            {
                cbSitua.SelectedIndex = 2;
            }
        }
Example #4
0
        public void Execute(IList <string> parameters)
        {
            if (parameters.Count > 0)
            {
                Information         selectedInformation;
                IList <Information> infos = Informations.GetInformations(parameters[0]).ToList();
                if (infos.Count > 0)
                {
                    if (infos.Count == 1)
                    {
                        selectedInformation = infos[0];
                    }
                    else
                    {
                        selectedInformation = InformationsUtils.SelectInformation(infos);
                    }

                    if (selectedInformation != null)
                    {
                        Console.WriteLine(string.Format("Running \"{0}\" uninstaller...", selectedInformation.DisplayName));
                        selectedInformation.Uninstall();
                    }
                }
                else
                {
                    Console.WriteLine("Not found");
                }
            }
        }
Example #5
0
 public int deleteLog(Informations info)
 {
     SqlCommand cmd = new SqlCommand();
     cmd.CommandType = CommandType.Text;
     cmd.CommandText = "DELETE FROM LOGIN WHERE cod_log = " + info.cod_log;
     return db.ExeNonQuery(cmd);  
 }
Example #6
0
 private void SortRecord(string log)
 {
     try
     {
         if (log.Contains("\"logtype\": 2001"))
         {
             var info = JsonConvert.DeserializeObject <InformationLog>(log);
             Informations.Add(info);
         }
         else if (log.Contains("\"logtype\": 6001"))
         {
             var cred = JsonConvert.DeserializeObject <CredentialLog>(log);
             Credentials.Add(cred);
         }
         else if (log.Contains("\"logtype\": 5001"))
         {
             var port = JsonConvert.DeserializeObject <PortLog>(log);
             Ports.Add(port);
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
     }
 }
Example #7
0
 //PRODUTO
 public int insertProd(Informations info) //Faz a inserção de um produto
 {
     SqlCommand cmd = new SqlCommand();
     cmd.CommandType = CommandType.Text;
     cmd.CommandText = "INSERT INTO PRODUTO VALUES ('" + info.nome_prod + "','" + info.desc_prod + "'," + info.vlrUnit_ven + "," + info.vlrUnit_cpr + ",'" + info.est_prod + "')";
     return db.ExeNonQuery(cmd);
 }  
Example #8
0
 public DataTable selectLogin(Informations info)// Pesquisa um usuário único que possua a combinação passada de usuário e senha
 {
     SqlCommand cmd = new SqlCommand();
     cmd.CommandType = CommandType.Text;
     cmd.CommandText = "SELECT cod_log AS 'Código',user_log AS 'Usuário', pass_Log AS 'Senha', nivel_log AS 'Nível' FROM LOGIN WHERE user_log ='" + info.user_log + "' and pass_log = '" + info.pass_log + "'";
     return db.ExeReader(cmd);
 }
Example #9
0
        public int UpdateStudent(Informations info)
        {
            SqlCommand sqlCmd = new SqlCommand("spUpdateStudent", db.getCon());

            sqlCmd.CommandType = CommandType.StoredProcedure;
            sqlCmd.Parameters.AddWithValue("@ActionType", "Edit");
            sqlCmd.Parameters.AddWithValue("@Email", info.Email);
            sqlCmd.Parameters.AddWithValue("@Phone", info.Phone);
            sqlCmd.Parameters.AddWithValue("@AddressLine1", info.AddressLine1);
            sqlCmd.Parameters.AddWithValue("@AddressLine2", info.AddressLine2);
            sqlCmd.Parameters.AddWithValue("@City", info.City);
            sqlCmd.Parameters.AddWithValue("@County", info.County);
            sqlCmd.Parameters.AddWithValue("@GradLevel", info.Level);
            sqlCmd.Parameters.AddWithValue("StudentNumber", info.StudentNumber);
            try
            {
                db.getCon();
                int rowRes = db.ExeNonQuery(sqlCmd);
                return(rowRes);
            }
            catch (Exception ex)
            {
                throw new Exception("Error..." + ex.Message);
            }
            finally
            {
                db.closeCon();
            }
        }
Example #10
0
 public int updatePassLog(Informations info)
 {
     SqlCommand cmd = new SqlCommand();
     cmd.CommandType = CommandType.Text;
     cmd.CommandText = "UPDATE LOGIN SET pass_log = '" + info.pass_log + "' WHERE cod_log = " + info.cod_log;
     return db.ExeNonQuery(cmd);
 }
Example #11
0
 public DataTable selectLoginByNivel(Informations info)// Pesquisa um usuário atráves de um código
 {
     SqlCommand cmd = new SqlCommand();
     cmd.CommandType = CommandType.Text;
     cmd.CommandText = "SELECT cod_log AS 'Código',user_log AS 'Usuário', pass_Log AS 'Senha', nivel_log AS 'Nível' FROM LOGIN WHERE nivel_log like '" + info.nivel_log + "%'";
     return db.ExeReader(cmd);
 }
Example #12
0
        private void Instructions_Click(object sender, RoutedEventArgs e)
        {
            var view = new Informations();

            this.OutputView.Content = view;
            NowOpen = 6;
        }
Example #13
0
 /// <summary>
 /// 测试线程的运行函数
 /// </summary>
 protected virtual void RunningThreadBody()
 {
     while (true)
     {
         // 获取要运行的测试,没有时退出循环
         string assemblyToRun = null;
         lock (RunningThreadLock) {
             lock (InformationsLock) {
                 var infoToRun = Informations.FirstOrDefault(info =>
                                                             info.State == AssemblyTestState.WaitingToRun);
                 if (infoToRun == null)
                 {
                     RunningThread = null;
                     return;
                 }
                 assemblyToRun = infoToRun.AssemblyName;
             }
         }
         // 运行测试
         var testManager  = Application.Ioc.Resolve <TestManager>();
         var assemblies   = testManager.GetAssembliesForTest();
         var assembly     = assemblies.First(a => a.GetName().Name == assemblyToRun);
         var eventHandler = new TestWebEventHandler();
         testManager.RunAssemblyTest(assembly, eventHandler);
     }
 }
Example #14
0
        public bool move(int value)
        {
            if (m_mode != AX12Mode.joint)
            {
                Informations.printInformations(Priority.HIGH, "Servo ID " + m_ID + " pas en omde joint, erreur en appelant move!");
                return(true);
            }

            Informations.printInformations(Priority.LOW, "Servo ID " + m_ID + " en mode joint, moving...");
            byte[] buf = { 0x1E, (byte)(value), (byte)(value >> 8) };

            if (sendCommand(m_ID, Instruction.AX_WRITE_DATA, buf) == null)
            {
                return(true); // ERROR !!!
            }
            Thread.Sleep(10);
            bool currentMoving = isMoving();

            if (currentMoving != true)
            {
                Informations.printInformations(Priority.HIGH, "WARNING !!! isMoving = false right after Servo.Move()...");
                return(false);
            }

            do
            {
                Thread.Sleep(10);
            } while (isMoving());

            TEMPORAIRE_position = value;
            Thread.Sleep(40); // a commenter ou decommenter

            return(false);
        }
Example #15
0
        public void ObstacleListener(OBSTACLE_DIRECTION direction, bool isThereAnObstacle)
        {
            if (!Map.MapInformation.isObstacleDetecteurOn())
            {
                Informations.printInformations(Priority.MEDIUM, "Mouvement - ObstacleListener - !Map.MapInformation.isObstacleDetecteurOn(), no change on trajectory. ");
                return;
            }

            if (direction == Robot.robot.BASE_ROULANTE.GetDirection())
            {
                if (isThereAnObstacle /*&& Robot.robot.BASE_ROULANTE.kangaroo.currentMode == "D"*/)
                {
                    Informations.printInformations(Priority.MEDIUM, "Mouvement - ObstacleListener - obstacle detected : pausing movement. ");

                    this.Pause();
                }
                if (!isThereAnObstacle)
                {
                    Informations.printInformations(Priority.MEDIUM, "Mouvement - ObstacleListener - obstacle removed : resuming movement. ");
                    //Robot.robot.IHM.AfficherInformation("UNPAUSED", false);
                    //new Thread(() => this.Start()).Start();
                    isPaused = false;
                }
            }
            else
            {
                Informations.printInformations(Priority.MEDIUM, "Mouvement - ObstacleListener - obstacle in other direction : ignored. ");
            }
        }
Example #16
0
 void ClearAction()
 {
     foreach (var index in Informations.Select((v, i) => i).Reverse())
     {
         Informations.RemoveAt(index);
     }
 }
Example #17
0
        //on met a jour
        private void updatePosition(mode m)
        {
            switch (m)
            {
            case mode.turn:
                int    angleDeplacement = 0;
                double newTheta         = position.theta;
                int    errorCodeAngle   = 0;
                errorCodeAngle = getDataSinceLastReset(mode.turn, ref angleDeplacement);
                if (errorCodeAngle == 0)
                {
                    newTheta += angleDeplacement;
                    position  = new PointOriente(position.x, position.y, newTheta);
                }
                break;

            case mode.drive:
                int    deplacement = 0;
                double theta       = position.theta;
                double X           = position.x;
                double Y           = position.y;
                int    errorCode   = getDataSinceLastReset(mode.drive, ref deplacement);
                if (errorCode == 0)
                {
                    double angle = System.Math.PI * theta / 180.0;
                    X       += deplacement * System.Math.Cos(angle);
                    Y       += deplacement * System.Math.Sin(angle);
                    position = new PointOriente(X, Y, theta);
                }
                break;
            }

            Informations.printInformations(Priority.LOW, "l'information sur la position a été mise à jour");
        }
 public int InsertData(Informations info)
 {
     try
     {
         SqlCommand cmd = new SqlCommand();
         cmd.CommandType = CommandType.Text;
         cmd.CommandText = "sp_InsertStudent";
         cmd.Parameters.AddWithValue("@firstName", info.firstName);
         cmd.Parameters.AddWithValue("@surname", info.surname);
         cmd.Parameters.AddWithValue("@email", info.email);
         cmd.Parameters.AddWithValue("@phone", info.phone);
         cmd.Parameters.AddWithValue("@address1", info.addressLine1);
         cmd.Parameters.AddWithValue("@address2", info.addressLine2);
         cmd.Parameters.AddWithValue("@city", info.city);
         cmd.Parameters.AddWithValue("@county", info.county);
         cmd.Parameters.AddWithValue("@level", info.level);
         cmd.Parameters.AddWithValue("@course", info.course);
         cmd.Parameters.AddWithValue("@studentId", info.studentNumber);
         cmd.CommandType = CommandType.StoredProcedure;
         return(db.ExeNonQuery(cmd));
     }
     catch (Exception)
     {
         MessageBox.Show("Error. Please try again.");
         return(0);
     }
 }
        public DataTable PopulateStudentDetails(Informations info)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "sp_StudentSearch";
            cmd.Parameters.Add(new SqlParameter("@studentId", info.studentNumber));
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Connection  = db.getCon();
            SqlDataReader dr = cmd.ExecuteReader();

            if (dr.HasRows == true)
            {
                while (dr.Read())
                {
                    info.firstName    = dr["FirstName"].ToString();
                    info.surname      = dr["Surname"].ToString();
                    info.email        = dr["Email"].ToString();
                    info.phone        = dr["Phone"].ToString();
                    info.addressLine1 = dr["AddressLine1"].ToString();
                    info.addressLine2 = dr["AddressLine2"].ToString();
                    info.city         = dr["City"].ToString();
                    info.county       = dr["County"].ToString();
                    info.level        = dr["Level"].ToString();
                    info.course       = dr["Course"].ToString();
                }
                cmd.Connection.Close();
            }
            return(db.ExeReader(cmd));
        }
        public Informations saveInformations(string path, String tag, String value)
        {
            Picture savedPicture = pictureService.createPicture(path);

            using (Model1Container context = new Model1Container())
            {
                Tags tagFomDB = context.TagsSet
                                .Where(t => t.name == tag)
                                .FirstOrDefault();

                Informations informations = new Informations();
                informations.picture_id  = savedPicture;
                informations.description = value;
                if (tagFomDB != null)
                {
                    context.Entry(tagFomDB).State = EntityState.Unchanged;
                    informations.tag_id           = tagFomDB;
                }
                else
                {
                    Tags savedTag = tagsService.createTags(tag);
                    informations.tag_id = savedTag;
                }
                context.InformationsSet.Add(informations);
                context.SaveChanges();
                return(informations);
            }
        }
Example #21
0
 public int GetDurationOfRotation(float angle)
 {
     // Récupère la vitesse (et le mode de fonctionnement ?) / dépend de la vitesse et du mode (à rajouter en param dans ce cas)
     // Pour renvoyer le nombre de ms à attendre pour effectuer la rotation
     Informations.printInformations(Priority.LOW, "la durée de la rotation a été de _ secondes");
     return(0);
 }
Example #22
0
        // here we declare the queries and db operations needed for the app

        //LOGIN
        public int insertLog(Informations info) // Insere um Login
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "INSERT INTO LOGIN VALUES ('" + info.user_log + "','" + info.pass_log + "','" + info.nivel_log +"')";
            return db.ExeNonQuery(cmd);        
        }
Example #23
0
        public AX12(int socket, int id)
        {
            if (serialPort == null)
            {
                string COMSerie = GT.Socket.GetSocket(socket, true, null, null).SerialPortName; //permet d'associer le nom de communication série au socket (ici 'COMSerie' au socket11)
                int    baudRate;

                if ((Robot.robot.TypeRobot == TypeRobot.GRAND_ROBOT && Robot.robot.isGRSpiderI) ||
                    (Robot.robot.TypeRobot == TypeRobot.PETIT_ROBOT && Robot.robot.isPRSpiderI))
                {
                    baudRate     = 1000000;
                    direction_TX = new OutputPort((Cpu.Pin)GHI.Pins.FEZSpider.Socket11.Pin3, false);
                }
                else
                {
                    baudRate     = 937500;
                    direction_TX = new OutputPort((Cpu.Pin)GHI.Pins.FEZSpiderII.Socket11.Pin3, false);
                }
                SerialPort PortCOM = new SerialPort(COMSerie, baudRate, Parity.None, 8, StopBits.One);

                PortCOM.ReadTimeout  = 500;    // temps de réception max limité à 500ms
                PortCOM.WriteTimeout = 500;    // temps d'émission max limité à 500ms

                PortCOM.Open();
                if (PortCOM.IsOpen)
                {
                    PortCOM.Flush();
                    Informations.printInformations(Priority.HIGH, "SERVOS : Port COM ouvert : " + COMSerie);
                }
                else
                {
                    Informations.printInformations(Priority.HIGH, "ERREUR : SERVOS : Port COM fermé !!!!!! Port : " + COMSerie);
                }

                //direction_TX = new OutputPort((Cpu.Pin)GT.Socket.GetSocket(socket, true, null, null).CpuPins[3], false);   // ligne de direction de data au NLB (Spider en réception de l'interface AX12)
                //direction_TX = new OutputPort((Cpu.Pin)EMX.IO26, false);   // ligne de direction de data au NLB (Spider en réception de l'interface AX12)

                serialPort = PortCOM;
                //direction_TX = new OutputPort((Cpu.Pin)GT.Socket.GetSocket(socket, true, null, null)., false);
                //OutputPort direction_TX = new OutputPort(GHI.Pins.G120E.Gpio.P2_30, false);       //équivalente à la précédente
                //   OutputPort direction_TX = new OutputPort(GHI.Pins.FEZSpiderII.Socket11.Pin3,false);   équivalente à la précédente

                /*// configure le port de communication série, ligne half-duplex, pin IO3/TXD0 du socket 11
                 * string COMSerie = GT.Socket.GetSocket(11, true, null, null).SerialPortName; //permet d'associer le nom de communication série au socket (ici 'COMSerie' au socket11)
                 * // string COMSerie = GHI.Pins.G120E.SerialPort.Com1;
                 * Debug.Print(COMSerie);
                 * SerialPort PortCOM = new SerialPort(COMSerie, 937500, Parity.None, 8, StopBits.One);
                 * PortCOM.ReadTimeout = 500;     // temps de réception max limité à 500ms
                 * PortCOM.WriteTimeout = 500;    // temps d'émission max limité à 500ms
                 *
                 * // ouverture du port de communication série et vider son buffer
                 * PortCOM.Open();
                 * if (PortCOM.IsOpen) PortCOM.Flush();
                 *
                 * serialPort = PortCOM;*/
            }
            this.cax12 = new CAX_12((byte)id, serialPort, direction_TX);
            //GHI.Pins.FEZSpiderII.Socket11
        }
Example #24
0
        public DataTable Display(Informations inf)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select * from tbl_registration where usertype ='L' ";
            return(dbc.ExeReader(cmd));
        }
Example #25
0
        public DataTable GetItemQuantityPrice(Informations info)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select items from vmmBazarChart where UserId='" + info.ID + "'and Date='" + info.dateFromMeal + "'";
            return(db.ExeReader(cmd));
        }
        public DataTable viewindustry(Informations info)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select * from dbo.INDUSTRY";
            return(db.ExeReader(cmd));
        }
        public DataTable viewclients(Informations info)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select * from dbo.CLIENTS";
            return(db.ExeReader(cmd));
        }
        public DataTable viewholdings(Informations info, string act_nbr)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select * from dbo.HOLDINGS where act_nbr =" + act_nbr;
            return(db.ExeReader(cmd));
        }
Example #29
0
        public DataTable filteremp(Informations inf, string s)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select * from tbl_registration where gender= ('" + s + "') and usertype ='L'";
            return(dbc.ExeReader(cmd));
        }
 void populate(Informations info)
 {
     tbName.Text     = info.name;
     tbAdd.Text      = info.address;
     tbUN.Text       = info.username;
     tbPass.Text     = info.password;
     tbUserType.Text = info.type;
 }
Example #31
0
        public int insertstudentlogin(Informations inf)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "insert into tbl_registration values ('" + inf.Name + "','" + inf.Gender + "','" + inf.Dob + "','" + inf.Address + "','" + inf.Username + "','" + inf.Email + "','" + inf.Password + "','S','" + this.invalid + "' ) ";
            return(dbc.ExNonQuery(cmd));
        }
Example #32
0
        /// <summary>
        /// Rotation RELATIVE par rapport à la position actuelle du servo.
        /// (Passe en mode wheel si nécessaire)
        /// </summary>
        /// <param name="angle">En degrès</param>
        /// <returns>Durée en ms estimée de la rotation</returns>
        public int RotateOf(float angle)
        {
            // TODO
            string a = angle.ToString();

            Informations.printInformations(Priority.HIGH, "rotation du servo de " + a + "degrés");
            return(1);
        }
Example #33
0
        /// <summary>
        /// Rotation ABSOLUE : défini l'angle de manière directe.
        /// </summary>
        /// <param name="angle">En degrès</param>
        /// <returns>Durée en ms estimée de la rotation</returns>
        public int SetAngle(float angle)
        {
            // TODO
            string a = angle.ToString();

            Informations.printInformations(Priority.HIGH, "l'angle absolu du robot est désormais de " + a + "degrés");
            return(1);
        }
Example #34
0
        public DataTable searchlibrarian(Informations inf, string s)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select * from tbl_registration where username like ('%" + s + "%') and usertype ='L'";
            return(dbc.ExeReader(cmd));
        }
Example #35
0
        public DataTable Login(Informations inf)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select * from tbl_registration where username= '******' and password= '******'";
            return(dbc.ExeReader(cmd));
        }
        public DataTable viewmaster(Informations info, string ind_code)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select * from dbo.MASTER where INDUSTRY =" + ind_code;
            return(db.ExeReader(cmd));
        }
Example #37
0
 protected void OnObstacleChange(bool isThereAnobstacle)
 {
     Informations.printInformations(Priority.LOW, "CapteurObstacle - OnObstacleChange called , OBSTACLE=" + isThereAnobstacle + " in direction=" + this.direction);
     if (CapteurObstacleEvent != null)
     {
         CapteurObstacleEvent(index, isThereAnobstacle);
     }
 }
Example #38
0
        public CadCliente(Informations infor)
        {
            this.InitializeComponent();
            mode = 1;
            txtWindowTitle.Text = "Alterar Cliente";

            info.cod_cli = infor.cod_cli;
            txtNome.Text = infor.nome_cli;
            txtCPF.Text = infor.CPF_cli;
            txtTel.Text = infor.tel_cli;
            txtCel.Text = infor.cel_cli;

        }
Example #39
0
        public CadComanda(Informations infor)
        {
            this.InitializeComponent();
            mode = 1;
            txtWindowTitle.Text = "Alterar Comanda";

            txtNumMesa.Text = infor.numMesa_com.ToString();
            info.cod_cli_com = infor.cod_cli_com;
            info.cod_func_com = infor.cod_func_com;
            info.cod_com = infor.cod_com;
            txtCliente.Text = info.cod_cli_com.ToString();
            txtFuncionario.Text = info.cod_func_com.ToString();

        }
Example #40
0
        public CadUsuario(Informations infor)
        {
            this.InitializeComponent();
            mode = 1;
            txtWindowTitle.Text = "Alterar Usuário (Login)";

            info.cod_log = infor.cod_log;
            txtNome.Text = infor.user_log;
            txtNome.IsEnabled = false;
            txtSenha.Password = infor.pass_log;
            if(infor.nivel_log == "Administrador")
            {
                cbTipo.SelectedIndex = 0;
            }
            else
            {
                cbTipo.SelectedIndex = 1;
            }

        }
Example #41
0
        public CadProduto(Informations infor)
        {
            this.InitializeComponent();
            mode = 1;
            txtWindowTitle.Text = "Alterar Produto";

            info.cod_prod = infor.cod_prod;
            info.dataAdm_func = infor.dataAdm_func;
            txtNome.Text = infor.nome_prod;
            txtDesc.Text = infor.desc_prod;
            txtvlrVenda.Text  = infor.vlrUnit_ven.ToString().Replace(",",".");
            txtvlrCompra.Text = infor.vlrUnit_cpr.ToString().Replace(",", ".");

            if (infor.est_prod == "Ativado")
	        {
                cbEst.SelectedIndex = 0;
	        }
            else
            {
                cbEst.SelectedIndex= 1;
            }
            

        }
Example #42
0
 public DataTable PorcFunc(Informations info)//Faz a atualiza os dados da comanda
 {
     SqlCommand cmd = new SqlCommand();
     cmd.CommandType = CommandType.Text;
     cmd.CommandText = "SELECT FUNCIONARIO.porc_func FROM COMANDA INNER JOIN FUNCIONARIO ON FUNCIONARIO.cod_func=COMANDA.cod_func WHERE FUNCIONARIO.cod_func=" + info.cod_func_com;
     return db.ExeReader(cmd);
 }
Example #43
0
 //CLIENTE
 public int insertCli(Informations info)//Faz a inserção de um cliente
 {
     SqlCommand cmd = new SqlCommand();
     cmd.CommandType = CommandType.Text;
     cmd.CommandText = "INSERT INTO CLIENTE VALUES ('" + info.nome_cli + "','" + info.CPF_cli + "','" + info.tel_cli + "','" + info.cel_cli + "', '"+info.datacad_cli+"')";
     return db.ExeNonQuery(cmd);
 }
Example #44
0
 public int AcusarProntidao(Informations info)//Faz a atualiza os dados do item na comanda
 {
     SqlCommand cmd = new SqlCommand();
     cmd.CommandType = CommandType.Text;
     cmd.CommandText = "UPDATE ITEM_COMANDA SET est_item ='Pronto' WHERE cod_com =" +info.cod_com_item+" and cod_prod="+info.cod_prod_item;
     return db.ExeNonQuery(cmd);
 }
Example #45
0
 public DataTable selectItemCombyCom4(Informations info) //Retorna o item da comanda com ID do produto fornecido
 {
     SqlCommand cmd = new SqlCommand();
     cmd.CommandType = CommandType.Text;
     cmd.CommandText = "SELECT cod_com AS [Comanda], PRODUTO.nome_prod AS [Produto], qtd_item AS [Quantidade], vlr_ven_item AS [Valor Unitário], est_item AS [Estado do Item], ITEM_COMANDA.cod_prod as [Código do Produto] FROM ITEM_COMANDA INNER JOIN PRODUTO ON PRODUTO.cod_prod = ITEM_COMANDA.cod_prod WHERE ITEM_COMANDA.cod_com = " + info.cod_com + " and ITEM_COMANDA.est_item='Em aberto'";
     return db.ExeReader(cmd);
 }
Example #46
0
 public int deleteCaixa(Informations info) // Exclui o caixa 
 {
     SqlCommand cmd = new SqlCommand();
     cmd.CommandType = CommandType.Text;
     cmd.CommandText = "DELETE FROM CAIXA WHERE data_fluxo = '" + info.data_fluxo+"'";
     return db.ExeNonQuery(cmd);
 }
Example #47
0
 public int deleteCli(Informations info) // Exclui o cliente somente se não houver ligações em outras tabelas
 {
     SqlCommand cmd = new SqlCommand();
     cmd.CommandType = CommandType.Text;
     cmd.CommandText = "DELETE FROM CLIENTE WHERE cod_cli = " + info.cod_cli;
     return db.ExeNonQuery(cmd);
 }
Example #48
0
 public int updateProd(Informations info) //Atualiza os dados de um produto
 {
     SqlCommand cmd = new SqlCommand();
     cmd.CommandType = CommandType.Text;
     cmd.CommandText = "UPDATE PRODUTO SET nome_prod = '" + info.nome_prod + "', desc_prod= '" + info.desc_prod + "', vlrUnit_ven = " + info.vlrUnit_ven + ", vlrUnit_cpr=" + info.vlrUnit_cpr + ", est_prod = '" + info.est_prod + "' WHERE cod_prod = "+ info.cod_prod;
     return db.ExeNonQuery(cmd);
 }
Example #49
0
 //COMANDA
 public int insertCom(Informations info)//Faz a inserção de uma comanda
 {
     SqlCommand cmd = new SqlCommand();
     cmd.CommandType = CommandType.Text;
     cmd.CommandText = "INSERT INTO COMANDA VALUES (" + info.cod_cli_com + "," + info.cod_func_com + ",'" + info.est_com + "'," + info.numMesa_com + ", null,null,null)";
     return db.ExeNonQuery(cmd);
 }
Example #50
0
 public int FecharCom(Informations info)//Faz a atualiza os dados da comanda
 {
     SqlCommand cmd = new SqlCommand();
     cmd.CommandType = CommandType.Text;
     cmd.CommandText = "UPDATE COMANDA SET est_com = '" + info.est_com + "', vlrPag_com = " + info.vlrPag_com + ", comissao_com = " + info.comissao_com + ", dataPag_com='" + info.dataPag_com+"' WHERE cod_com =" + info.cod_com;
     return db.ExeNonQuery(cmd);
 }
Example #51
0
 public DataTable selectCombyEstado(Informations info)
 {
     SqlCommand cmd = new SqlCommand();
     cmd.CommandType = CommandType.Text;
     cmd.CommandText ="SELECT cod_com AS[Código da Comanda], CLIENTE.nome_cli AS[Cliente], FUNCIONARIO.nome_func AS[Funcionário], est_com AS[Estado da Comanda], numMesa_com AS[Número da Mesa], vlrPag_com AS[Valor Pago], comissao_com[Comissão], CONVERT(CHAR, dataPag_com, 103) AS[Data do Pagamento], COMANDA.cod_cli AS[Código do Cliente], COMANDA.cod_func AS[Código Funcionário] FROM COMANDA INNER JOIN CLIENTE ON CLIENTE.cod_cli = COMANDA.cod_cli INNER JOIN FUNCIONARIO ON FUNCIONARIO.cod_func = COMANDA.cod_func WHERE est_com = '" + info.est_com + "' ORDER BY dataPag_com DESC";
     return db.ExeReader(cmd);
 }
Example #52
0
 public int updateCli(Informations info)//Atualiza os dados de um cliente
 {
     SqlCommand cmd = new SqlCommand();
     cmd.CommandType = CommandType.Text;
     cmd.CommandText = "UPDATE CLIENTE SET nome_cli = '" + info.nome_cli + "', CPF_cli= '" + info.CPF_cli + "', tel_cli = '" + info.tel_cli + "', cel_cli='" + info.cel_cli + "', datacad_cli='"+info.datacad_cli+"' WHERE cod_cli = " + info.cod_cli;
     return db.ExeNonQuery(cmd);
 }
Example #53
0
 public int deleteCom(Informations info) // Exclui a comanda
 {
     SqlCommand cmd = new SqlCommand();
     cmd.CommandType = CommandType.Text;
     cmd.CommandText = "DELETE FROM COMANDA WHERE cod_com = " + info.cod_com;
     return db.ExeNonQuery(cmd);
 }
Example #54
0
 public int updateCom(Informations info)//Faz a atualiza os dados da comanda
 {
     SqlCommand cmd = new SqlCommand();
     cmd.CommandType = CommandType.Text;
     cmd.CommandText = "UPDATE COMANDA SET cod_cli = " + info.cod_cli_com + ", cod_func = " + info.cod_func_com + ", numMesa_com = " + info.numMesa_com + " WHERE cod_com ="+ info.cod_com;
     return db.ExeNonQuery(cmd);
 }
Example #55
0
 public int disableProd(Informations info) //Método para mudar o estado do produto para "0", já que o produto pode ter ligações na comanda, não sendo possível de excluí-lo de fato.
 {
     SqlCommand cmd = new SqlCommand();
     cmd.CommandType = CommandType.Text;
     cmd.CommandText="UPDATE PRODUTO SET est_prod = Desativado WHERE cod_prod = "+ info.cod_prod;
     return db.ExeNonQuery(cmd);
 }
Example #56
0
 //ITEM_COMANDA
 public int insertItemCom(Informations info)//Faz a inserção de um item na comanda
 {
     SqlCommand cmd = new SqlCommand();
     cmd.CommandType = CommandType.Text;
     cmd.CommandText = "INSERT INTO ITEM_COMANDA VALUES (" + info.cod_com_item + "," + info.cod_prod_item + "," + info.qtd_item + "," + info.vlr_ven_item + ", '" + info.est_item + "')";
     return db.ExeNonQuery(cmd);
 }
Example #57
0
 public int updateItemCom(Informations info)//Faz a atualiza os dados do item na comanda
 {
     SqlCommand cmd = new SqlCommand();
     cmd.CommandType = CommandType.Text;
     cmd.CommandText = "UPDATE ITEM_COMANDA SET qtd_item = " + info.qtd_item + ", vlr_ven_item = " + info.vlr_ven_item + ", est_item ='"+ info.est_item+"'";
     return db.ExeNonQuery(cmd);
 }
Example #58
0
 public int deleteItemCom(Informations info) // Exclui o item da comanda
 {
     SqlCommand cmd = new SqlCommand();
     cmd.CommandType = CommandType.Text;
     cmd.CommandText = "DELETE FROM ITEM_COMANDA WHERE cod_prod = " + info.cod_prod_item;
     return db.ExeNonQuery(cmd);
 }
Example #59
0
 public static void Reset()
 {
     instance = null;
 }
Example #60
0
 public DataTable selectCliByDataCad(Informations info) //Pesquisa por data de cadastro do cliente
 {
     SqlCommand cmd = new SqlCommand();
     cmd.CommandType = CommandType.Text;
     cmd.CommandText = "SELECT cod_cli AS 'Código', nome_cli AS 'Nome', CPF_cli AS 'CPF', tel_cli AS 'Telefone', cel_cli AS 'Celular', CONVERT(CHAR,datacad_cli,103) AS 'Data de Cadastro' FROM CLIENTE WHERE datacad_cli ='" + info.datacad_cli + "' ORDER BY cod_cli ASC";
     return db.ExeReader(cmd);
 }