Пример #1
0
        public static string ValidarMaquina(string sMachine)
        {
            string                retorno   = "0";
            DataTable             DTRetorno = null;
            string                strError  = string.Empty;
            InterfazDAL_tticol132 tticol132 = new InterfazDAL_tticol132();

            if (string.IsNullOrEmpty(sMachine))
            {
                retorno = "0";
            }
            else
            {
                try
                {
                    DTRetorno = tticol132.ValidarMaquina(sMachine, ref strError);
                    if (DTRetorno.Rows.Count > 0)
                    {
                        retorno = string.Empty;
                    }
                }
                catch (Exception ex)
                {
                    retorno = ex.InnerException != null ?
                              ex.Message + " (" + ex.InnerException + ")" :
                              ex.Message;
                }
            }
            return(retorno);
        }
Пример #2
0
        protected void btnConsultar_Click(object sender, EventArgs e)
        {
            if (txtMachine.Text.Trim() != String.Empty)
            {
                _machine = txtMachine.Text.Trim().ToUpper();
                var ckot = slType.SelectedValue.Trim();

                var validarMaquina = _idaltticol132.ValidarMaquina(_machine, ref strError);

                if (validarMaquina.Rows.Count > 0)
                {
                    _dscaMachine = validarMaquina.Rows[0]["DSCA"].ToString().Trim().ToUpper();

                    _recordsTask = _idalttirou003.listRecordsByCkot(ref ckot, ref strError);

                    if (_recordsTask.Rows.Count < 0)
                    {
                        lblError.Text   = mensajes("notexiststask");
                        lblConfirm.Text = string.Empty;
                        return;
                    }

                    _recordsLaborType = _idalttihra130.listRecords(ref strError);
                    _recordsComments  = _idaltticol077.listRecords(ref strError);

                    _ordersTurn = _idaltticol111.findRecordsByMcnoTimeRegistration(ref _machine, ref strError);

                    divBtnGuardar.Visible = true;
                    makeTable();
                    lblError.Text   = string.Empty;
                    lblConfirm.Text = string.Empty;
                }
                else
                {
                    divBtnGuardar.Visible = false;
                    divTable.InnerHtml    = String.Empty;
                    lblError.Text         = mensajes("notexistsmachine");
                    lblConfirm.Text       = string.Empty;
                    return;
                }
            }
            else
            {
                lblError.Text   = mensajes("formempty");
                lblConfirm.Text = string.Empty;
                return;
            }
        }
        protected void btnConsultar_Click(object sender, EventArgs e)
        {
            slItem1.Items.Clear();
            slItem2.Items.Clear();
            slItem3.Items.Clear();
            slItem4.Items.Clear();
            slItem5.Items.Clear();

            lblError.Text = String.Empty;
            var machine = txtMachine.Text.Trim().ToUpper();

            if (machine == String.Empty)
            {
                lblError.Text = mensajes("formempty");
                return;
            }

            //Consulta machine
            var consultaMaquina = _idaltticol132.ValidarMaquina(machine, ref strError);

            if (consultaMaquina.Rows.Count > 0)
            {
                //consulta items
                var consultaItem = _idalttcibd001.findRecordsSupplies(ref strError);

                if (consultaItem.Rows.Count > 0)
                {
                    List <ListItem> _listaRegistros = new List <ListItem>();

                    ListItem itemSelect = new ListItem();
                    itemSelect.Text  = _idioma == "INGLES" ? "--Select an option--" : "--Seleccione--";
                    itemSelect.Value = "";

                    _listaRegistros.Add(itemSelect);

                    foreach (DataRow item in consultaItem.Rows)
                    {
                        ListItem row = new ListItem();
                        row.Text = String.Concat(item["ITEM"].ToString().Trim().ToUpper(), " |-"
                                                 , item["DSCA"].ToString().Trim().ToUpper(), " -. "
                                                 , item["CWAR"].ToString().Trim().ToUpper(), " - "
                                                 , item["CUNI"].ToString().Trim().ToUpper(), " -|"
                                                 , item["STOCK"].ToString().Trim().ToUpper());
                        row.Value = item["ITEM"].ToString().Trim().ToUpper();
                        row.Attributes.Add("stock", item["STOCK"].ToString().Trim().ToUpper());
                        _listaRegistros.Add(row);
                    }

                    for (int i = 0; i < _listaRegistros.Count; i++)
                    {
                        slItem1.Items.Insert(i, _listaRegistros[i]);
                        slItem2.Items.Insert(i, _listaRegistros[i]);
                        slItem3.Items.Insert(i, _listaRegistros[i]);
                        slItem4.Items.Insert(i, _listaRegistros[i]);
                        slItem5.Items.Insert(i, _listaRegistros[i]);
                    }

                    txtMachine1.Text = txtMachine.Text.Trim().ToUpper();
                    txtMachine2.Text = txtMachine.Text.Trim().ToUpper();
                    txtMachine3.Text = txtMachine.Text.Trim().ToUpper();
                    txtMachine4.Text = txtMachine.Text.Trim().ToUpper();
                    txtMachine5.Text = txtMachine.Text.Trim().ToUpper();

                    txtQuantity1.Text = "0";
                    txtQuantity2.Text = "0";
                    txtQuantity3.Text = "0";
                    txtQuantity4.Text = "0";
                    txtQuantity5.Text = "0";

                    lblValueMachine.Text = txtMachine.Text.Trim().ToUpper();

                    divTable.Visible = true;
                }
                else
                {
                    divTable.Visible = false;
                    lblError.Text    = mensajes("queryblank");
                    return;
                }
            }
            else
            {
                lblError.Text = mensajes("machinenotexists");
                return;
            }
        }