示例#1
0
        public void LoadDatasInterface(int ProductId, int OperatorId, int ClientId, int FactoryId)
        {
            OrderDataSet dataset = new OrderDataSet();

            OrderDataSetTableAdapters.ProductsTableAdapter  tableproduct  = new OrderDataSetTableAdapters.ProductsTableAdapter();
            OrderDataSetTableAdapters.OperatorsTableAdapter tableOperator = new OrderDataSetTableAdapters.OperatorsTableAdapter();
            OrderDataSetTableAdapters.ClientsTableAdapter   tableClient   = new OrderDataSetTableAdapters.ClientsTableAdapter();
            OrderDataSetTableAdapters.FactoriesTableAdapter tableFactory  = new OrderDataSetTableAdapters.FactoriesTableAdapter();

            string CodeProducts  = "";
            string NameProducts  = "";
            string CodeOperators = "";
            string NameOperators = "";
            string CodeClients   = "";
            string NameClients   = "";
            string CodeFactories = "";
            string NameFactories = "";

            //datos produtcto
            CodeProducts = tableproduct.GetDataById(ProductId)[0].Code;
            NameProducts = tableproduct.GetDataById(ProductId)[0].Name;
            ProductCode  = CodeProducts;
            ProductName  = NameProducts;

            //datos operador
            CodeOperators = tableOperator.GetDataById(OperatorId)[0].Code;
            NameOperators = tableOperator.GetDataById(OperatorId)[0].Name;
            OperatorCode  = CodeOperators;
            OperatorName  = NameOperators;

            //datos cliente
            CodeClients = tableClient.GetDataById(ClientId)[0].Code;
            NameClients = tableClient.GetDataById(ClientId)[0].Name;
            ClientCode  = CodeClients;
            ClientName  = NameClients;

            //datos factoría
            CodeFactories = tableFactory.GetDataById(FactoryId)[0].Code;
            NameFactories = tableFactory.GetDataById(FactoryId)[0].Name;
            FactoryCode   = CodeFactories;
            FactoryName   = NameFactories;
        }
示例#2
0
        private void UpdateClientInfo(int id)
        {
            if (id > 0)
            {
                OrderDataSet ds = new OrderDataSet();
                OrderDataSetTableAdapters.ClientsTableAdapter adapter = new OrderDataSetTableAdapters.ClientsTableAdapter();
                OrderDataSet.ClientsDataTable dataTable = adapter.GetDataById(id);

                if (dataTable.Rows.Count > 0)
                {
                    OrderDataSet.ClientsRow row = (OrderDataSet.ClientsRow)dataTable.Rows[0];

                    ClientCode = row.Code;
                    ClientName = row.Name;
                }
            }
        }