示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            MaterialCore.EmbarquesZodiac.EscanearTN scanTN = new EscanearTN();
            DialogResult dr = new DialogResult();

            dr = scanTN.ShowDialog(this);
            if (dr == DialogResult.OK)
            {
                RecargarDatos();
            }
        }
示例#2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            this.Cursor       = Cursors.WaitCursor;
            btnCancel.Enabled = true;

            for (int x = 0; x < dgvEmbarques.SelectedRows.Count; x++)
            {
                string picker   = txtPicker.Text.Trim();
                string tracknum = txtTracking.Text.Trim();
                int    id       = int.Parse(dgvEmbarques.SelectedRows[x].Cells["idDataGridViewTextBoxColumn"].Value.ToString());
                //ARRIVAL
                if (dateArrival.Checked == true)
                {
                    this.embarquesZodiacTableAdapter.UpdateArrivalDate(dateArrival.Value, id);
                }
                //PICKUP
                if (datePickup.Checked == true)
                {
                    this.embarquesZodiacTableAdapter.UpdatePickupDate(datePickup.Value, id);;
                }

                //PICKUP WAS REQUESTED
                if (datePickupWas.Checked == true)
                {
                    this.embarquesZodiacTableAdapter.UpdatePickupDateRequested(datePickupWas.Value, id);
                }
                //UNLOADED
                if (dateUnloaded.Checked == true)
                {
                    this.embarquesZodiacTableAdapter.UpdateUnloadedDate(dateUnloaded.Value, id);
                }
                this.embarquesZodiacTableAdapter.UpdatePicker(picker, id);
                //PREGUNTA SI EXISTE EL TRACKING NUMBER

                this.embarquesZodiacTableAdapter.UpdateTrackingNumber(tracknum, id);

                this.embarquesZodiacTableAdapter.UpdateReceived(chkReceived.Checked, id);
                this.embarquesZodiacTableAdapter.UpdateDone(chkDone.Checked, id);
            }
            if (txtTracking.Text.Trim() != "")
            {
                da = _con.getDataAdapter("SELECT nid_sku FROM dbo.sku_escanear WHERE nid_cliente = 52 AND nid_sku='" + txtTracking.Text.Trim() + "'");
                dt = new DataTable();
                da.Fill(dt);
                if (dt.Rows.Count == 0)
                {
                    this.sku_escanearTableAdapter.InsertskuEscanear(txtTracking.Text.Trim(), DateTime.Now, false, 52);
                }
            }
            if (chkScan.Checked == true)
            {
                MaterialCore.EmbarquesZodiac.EscanearTN scanTN = new EscanearTN(txtTracking.Text);
                scanTN.ShowDialog(this);
            }


            foreach (DataGridViewRow fila in dgvEmbarques.SelectedRows)
            {
                DataTable datatable = this.embarquesZodiacTableAdapter.GetDataByRegistro(int.Parse(fila.Cells["idDataGridViewTextBoxColumn"].Value.ToString()));
                object    value     = datatable.Rows[0]["registroRBI"];
                if (value == DBNull.Value)
                {
                    this.embarquesZodiacTableAdapter.UpdateQueryRegistro(DateTime.Now, MaterialCore.Clases.Logueado.Login.ToString(), int.Parse(fila.Cells["idDataGridViewTextBoxColumn"].Value.ToString()));
                }
            }

            RecargarDatos();
            this.Cursor = Cursors.Default;
        }