/// <summary> /// Se envia el comando de acuerdo a los campos ingresados /// </summary> private void CommandsSend() { int row = 0; int col = 0; string result = string.Empty; string sabre = string.Empty; string change = string.Empty; string name = string.Empty; string send = string.Concat("HB", txtNumberFirm.Text); using (CommandsAPI objCommand = new CommandsAPI()) { result = objCommand.SendReceive(send); } CommandsQik.searchResponse(result, "STATUS", ref row, ref col); if (row != 0 || col != 0) { row = 0; col = 0; send = string.Empty; sabre = string.Concat("H/PASS", txtPasswordTemp.Text); send = string.Concat("H/AUTH BY ", txtAuthorization.Text); using (CommandsAPI objCommand = new CommandsAPI()) { objCommand.SendReceive(sabre); objCommand.SendReceive(send); } if (rdoEnable.Checked) { using (CommandsAPI objCommand = new CommandsAPI()) { result = objCommand.SendReceive("HX ACTIVE"); } CommandsQik.searchResponse(result, Resources.Reservations.STATUS_ALREADY_ACTIVE, ref row, ref col); if (row != 0 || col != 0) { MessageBox.Show(Resources.Reservations.FIRMA_YA_ESTABA_ACTIVA, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); using (CommandsAPI objCommand = new CommandsAPI()) { result = objCommand.SendReceive("I"); } } CommandsQik.searchResponse(result, "DONE", ref row, ref col); if (row != 0 || col != 0) { MessageBox.Show(Resources.Reservations.FIRMA_HA_QUEDADO_ACTIVA, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); EnableDisableFirmBL.EnableDisableFirm(txtNumberFirm.Text + "_IN", txtPCC.Text, 1); } } else if (rdoDisable.Checked) { using (CommandsAPI objCommand = new CommandsAPI()) { result = objCommand.SendReceive("HX INACTIVE"); } CommandsQik.searchResponse(result, Resources.Reservations.STATUS_ALREADY_INACTIVE, ref row, ref col); if (row != 0 || col != 0) { MessageBox.Show(Resources.Reservations.FIRMA_YA_ESTABA_INACTIVA, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); using (CommandsAPI objCommand = new CommandsAPI()) { result = objCommand.SendReceive("I"); } } CommandsQik.searchResponse(result, "DONE", ref row, ref col); if (row != 0 || col != 0) { MessageBox.Show(Resources.Reservations.FIRMA_HA_QUEDADO_ACTIVA, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); EnableDisableFirmBL.EnableDisableFirm(txtNumberFirm.Text, txtPCC.Text, 2); } } } else { MessageBox.Show(Resources.Reservations.LA_FIRMA_NO_EXISTE, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); using (CommandsAPI objCommand = new CommandsAPI()) { result = objCommand.SendReceive("I"); } } }
/// <summary> /// Se envia el comando de acuerdo a los campos ingresados /// </summary> private void CommandsSend() { User usuarioDto = null; usuarioDto = UserBL.GetUser(txtNumberFirm.Text, txtPCC.Text); if (rbnBoth.Checked) { int row = 0; int col = 0; string result = string.Empty; string sabre = string.Empty; using (CommandsAPI objCommand = new CommandsAPI()) { objCommand.SendReceive(string.Concat("QMOV/", usuarioDto.PCC, usuarioDto.Queue, "/", usuarioDto.PCC, "152")); } string send = string.Concat("HB", txtNumberFirm.Text); using (CommandsAPI objCommand = new CommandsAPI()) { result = objCommand.SendReceive(send); } CommandsQik.searchResponse(result, "NEW EMPLOYEE", ref row, ref col); if (row != 0 || col != 0) { row = 0; col = 0; MessageBox.Show(Resources.Reservations.LA_FIRMA_NO_EXISTE, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); using (CommandsAPI objCommand = new CommandsAPI()) { result = objCommand.SendReceive("I"); } } else { send = string.Concat("H/AUTH BY ", txtAuthorization.Text); sabre = string.Concat("HX*REUSE"); using (CommandsAPI objCommand = new CommandsAPI()) { objCommand.SendReceive(send); result = objCommand.SendReceive(sabre); } CommandsQik.searchResponse(result, "DONE", ref row, ref col); if (row != 0 || col != 0) { send = string.Concat("QS/", txtPCC.Text, txtQueue.Text, "/D-", txtAgent.Text); using (CommandsAPI objCommand = new CommandsAPI()) { objCommand.SendReceive(send); } CommandsAPI2.send_MessageToEmulator(string.Concat(Resources.Reservations.FIRMA_ELIMINADA_EXITO)); //DeleteUsersBL.DeleteUsers(txtNumberFirm.Text, txtPCC.Text); EnableDisableFirmBL.EnableDisableFirm(txtNumberFirm.Text, txtPCC.Text, 2); Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); MessageBox.Show(Resources.Reservations.FIRMA_FUE_ELIMINADA_EXITO, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show(Resources.Reservations.PRESENTO_ERROR, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); using (CommandsAPI objCommand = new CommandsAPI()) { objCommand.SendReceive("I"); } } } if (!string.IsNullOrEmpty(usuarioDto.Firm)) { UpdateStatusAllFirmModulesBL.UpdateUnassignStatusTA(usuarioDto.TA); UpdateStatusAllFirmModulesBL.UpdateUnassignStatusQueue(usuarioDto.Queue); UpdateStatusAllFirmModulesBL.UpdateUnassignStatusAgent(usuarioDto.Agent); //UpdateStatusAllFirmModulesBL.UpdateUnassignStatusFirm(usuarioDto.Firm); } MessageBox.Show("FIRMA ELIMINADA CORRECTAMENTE", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); } if (rbnMyCTS.Checked) { using (CommandsAPI objCommand = new CommandsAPI()) { objCommand.SendReceive(string.Concat("QMOV/", usuarioDto.PCC, usuarioDto.Queue, "/", usuarioDto.PCC, " 152")); } //DeleteUsersBL.DeleteUsers(txtNumberFirm.Text, txtPCC.Text); EnableDisableFirmBL.EnableDisableFirm(txtNumberFirm.Text, txtPCC.Text, 2); if (!string.IsNullOrEmpty(usuarioDto.Firm)) { UpdateStatusAllFirmModulesBL.UpdateUnassignStatusTA(usuarioDto.TA); UpdateStatusAllFirmModulesBL.UpdateUnassignStatusQueue(usuarioDto.Queue); UpdateStatusAllFirmModulesBL.UpdateUnassignStatusAgent(usuarioDto.Agent); //UpdateStatusAllFirmModulesBL.UpdateUnassignStatusFirm(usuarioDto.Firm); } MessageBox.Show("LA FIRMA FUE ELIMINADA CON ÉXITO DE MyCTS", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); } if (rbnSabre.Checked) { int row = 0; int col = 0; string result = string.Empty; string sabre = string.Empty; using (CommandsAPI objCommand = new CommandsAPI()) { objCommand.SendReceive(string.Concat("QMOV/", usuarioDto.PCC, usuarioDto.Queue, "/", usuarioDto.PCC, " 152")); } string send = string.Concat("HB", txtNumberFirm.Text); using (CommandsAPI objCommand = new CommandsAPI()) { result = objCommand.SendReceive(send); } CommandsQik.searchResponse(result, "NEW EMPLOYEE", ref row, ref col); if (row != 0 || col != 0) { row = 0; col = 0; MessageBox.Show(Resources.Reservations.LA_FIRMA_NO_EXISTE, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); using (CommandsAPI objCommand = new CommandsAPI()) { result = objCommand.SendReceive("I"); } } else { send = string.Concat("H/AUTH BY ", txtAuthorization.Text); sabre = string.Concat("HX*REUSE"); using (CommandsAPI objCommand = new CommandsAPI()) { objCommand.SendReceive(send); result = objCommand.SendReceive(sabre); } CommandsQik.searchResponse(result, "DONE", ref row, ref col); if (row != 0 || col != 0) { send = string.Concat("QS/", txtPCC.Text, txtQueue.Text, "/D-", txtAgent.Text); using (CommandsAPI objCommand = new CommandsAPI()) { objCommand.SendReceive(send); } CommandsAPI2.send_MessageToEmulator(string.Concat(Resources.Reservations.FIRMA_ELIMINADA_EXITO)); Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); } else { MessageBox.Show(Resources.Reservations.PRESENTO_ERROR, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); using (CommandsAPI objCommand = new CommandsAPI()) { objCommand.SendReceive("I"); } } } MessageBox.Show("FIRMA ELIMINADA CORRECTAMENTE", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); } }