public ActionResult ActualizarPorMA(tickets entidad) { var r = false; try { ctrlDetalle.ActualizarPorMA(new detalle_ticket { id_detalle_ticket = entidad.id_detalle_ticket, id_ticket = entidad.id_ticket, id_prioridad = entidad.id_prioridad, id_estado = entidad.id_estado, id_agente = entidad.id_agente, }); if (!r) { return(Json("Error al realizar la operacion", JsonRequestBehavior.AllowGet)); } return(Json("Realizado", JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(View("Error", new HandleErrorInfo(ex, "Detalle_Ticket", "Update por MA"))); } }
/// <summary> /// 获取指定的两票详情 /// </summary> /// <param name="id"></param> /// <returns></returns> public tickets GetTicketsDetail(int id, string begin_date, string end_date) { tickets recv = new tickets(); try { string path = "api/tickets/" + id; string url = BaseUri + path; if (begin_date != null) { url += "?begin_date=" + begin_date; } else { url += "?begin_date"; } if (end_date != null) { url += "&end_date=" + end_date; } else { url += "&end_date"; } return(GetEntityDetail <tickets>(url)); } catch (Exception ex) { string messgae = ex.Message; } return(recv); }
public ActionResult DeleteConfirmed(int id) { tickets tickets = db.tickets.Find(id); db.tickets.Remove(tickets); db.SaveChanges(); return(RedirectToAction("Index")); }
public void tic_test() { DLL obj = new DLL(); bookuser bobj = new bookuser(); tickets ch = obj.ticket_Deserialize("C:/Users/Rahul Kalsangra/source/repos/Project02/tickets.xml", bobj); Assert.AreEqual(ch.contactlist[0].BusName, "Ajanata Travels"); }
public tickets ObtenerEstados(usuarios usuario) { tickets entidad = new tickets(); try { AbrirConexion(); StringBuilder CadenaSql = new StringBuilder(); SqlCommand comandoSelect = new SqlCommand(); comandoSelect.Connection = Conexion; comandoSelect.CommandType = CommandType.StoredProcedure; comandoSelect.CommandText = "DML_Count_Tickets"; comandoSelect.Parameters.AddWithValue("@Sentencia", "Select"); if (usuario != null && usuario.tipo_usuario == "Supervisor") { comandoSelect.Parameters.AddWithValue("@IdUsuario", usuario.id_usuario); } if (usuario != null && usuario.tipo_usuario == "Agente") { comandoSelect.Parameters.AddWithValue("@IdAgente", usuario.id_usuario); } using (var dr = comandoSelect.ExecuteReader()) { if (dr.Read()) { entidad.vencidos = int.Parse(dr["Vencidos"].ToString()); entidad.abiertos = int.Parse(dr["Abierto"].ToString()); entidad.en_espera = int.Parse(dr["En_Espera"].ToString()); entidad.en_proceso = int.Parse(dr["En_Proceso"].ToString()); entidad.vence_hoy = int.Parse(dr["Vence_Hoy"].ToString()); entidad.sin_asignar = int.Parse(dr["Sin_Asignar"].ToString()); entidad.otros = int.Parse(dr["Otros"].ToString()); } } } catch (InvalidCastException ex) { ApplicationException excepcion = new ApplicationException("Se genero un error de conversión de tipos con el siguiente mensaje: " + ex.Message, ex); excepcion.Source = "Insertar tickets"; throw excepcion; } catch (Exception ex) { ApplicationException excepcion = new ApplicationException("Se genero un error de aplicación con el siguiente mensaje: " + ex.Message, ex); excepcion.Source = "Insertar tickets"; throw excepcion; } finally { CerrarConexion(); } return(entidad); }
private void button2_Click(object sender, EventArgs e) { slidepanel.Height = button2.Height; slidepanel.Top = button2.Top; tickets t = new tickets(); panel5.Controls.Clear(); panel5.Controls.Add(t); t.BringToFront(); }
static private void Main(string[] args) { HttpClient httpClient = new HttpClient(); tickets codeBaseTickets = CodeBaseMethods.RetrieveTickets(httpClient, "codeBaseApiKey", "projectName", "accountName", "userName"); //CodeBaseMethods.WriteTicketsToFile("myTickets.xml", codeBaseTickets); //tickets codeBaseTickets = CodeBaseMethods.ReadTicketsFromFile("myTickets.xml"); GitLabMethods.UploadGitLabTickets(httpClient, codeBaseTickets.ticket, "gitLabAccessToken", "projectName", "userName"); Console.ReadKey(); }
public ActionResult Edit([Bind(Include = "tickets1,Incidencias,Requerimiento,Soporte")] tickets tickets) { if (ModelState.IsValid) { db.Entry(tickets).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Soporte = new SelectList(db.precios, "precio", "precio", tickets.Soporte); ViewBag.Requerimiento = new SelectList(db.precios, "precio", "precio", tickets.Requerimiento); ViewBag.Incidencias = new SelectList(db.precios, "precio", "precio", tickets.Incidencias); return(View(tickets)); }
public List <tickets> ObtenerPrioridad() { List <tickets> lista = new List <tickets>(); tickets entidad = new tickets(); try { AbrirConexion(); StringBuilder CadenaSql = new StringBuilder(); SqlCommand comandoSelect = new SqlCommand(); comandoSelect.Connection = Conexion; comandoSelect.CommandType = CommandType.StoredProcedure; comandoSelect.CommandText = "DML_Count_Tickets"; comandoSelect.Parameters.AddWithValue("@Sentencia", "Prioridad"); using (var dr = comandoSelect.ExecuteReader()) { while (dr.Read()) { entidad = new tickets(); entidad.id_usuario = int.Parse(dr["id_usuario"].ToString()); entidad.usuario = dr["usuario"].ToString(); entidad.id_sucursal = int.Parse(dr["id_sucursal"].ToString()); entidad.sucursal = dr["sucursal"].ToString(); entidad.prioridad = dr["prioridad"].ToString(); entidad.no_tickets = int.Parse(dr["tickets"].ToString()); lista.Add(entidad); } } } catch (InvalidCastException ex) { ApplicationException excepcion = new ApplicationException("Se genero un error de conversión de tipos con el siguiente mensaje: " + ex.Message, ex); excepcion.Source = "Insertar tickets"; throw excepcion; } catch (Exception ex) { ApplicationException excepcion = new ApplicationException("Se genero un error de aplicación con el siguiente mensaje: " + ex.Message, ex); excepcion.Source = "Insertar tickets"; throw excepcion; } finally { CerrarConexion(); } return(lista); }
// GET: tickets/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tickets tickets = db.tickets.Find(id); if (tickets == null) { return(HttpNotFound()); } return(View(tickets)); }
public ActionResult GetEstadosTickets() { tickets entidad = new tickets(); usuarios usuario = new usuarios(); int id_usuario = int.Parse(Session["id_usuario"].ToString()); usuario = ctrlUsuarios.Obtener(id_usuario); entidad = control.ObtenerEstados(usuario); var serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); serializer.MaxJsonLength = 500000000; var json = Json(new { data = entidad }, JsonRequestBehavior.AllowGet); json.MaxJsonLength = 500000000; return(json); }
public static void Main() { IDictionary <string, string> ticketlist = new Dictionary <string, string>(); while (true) { System.Console.WriteLine("======================================="); System.Console.WriteLine("Welcome to Ticket Reservation System:"); System.Console.WriteLine("Enter:"); System.Console.WriteLine("1. Book A ticket"); System.Console.WriteLine("2. Cancel A Booking"); System.Console.WriteLine("3. See The booked Tickets:"); System.Console.WriteLine("4. Exit"); String choice = Console.ReadLine(); if (choice == "1") { customer c1 = new customer(); tickets t1 = new tickets(); System.Console.WriteLine("Enter Your Username:"******"Enter Your Phone Number:"); c1.phone = Console.ReadLine(); c1.enrollment++; ticketlist.Add(c1.username, (t1.ticketnumber).ToString()); System.Console.WriteLine("Ticket Booked: " + ticketlist.Count); } else if (choice == "2") { System.Console.WriteLine("Enter Your Username:"******"Ticket Cancelled"); } else if (choice == "3") { System.Console.WriteLine("Tickets Booked In Total: " + ticketlist.Count); } else if (choice == "4") { break; } else { System.Console.WriteLine("Wrong Input Entered"); } } }
/// <summary> /// 获取指定的两票详情 /// </summary> /// <param name="id"></param> /// <returns></returns> public tickets GetTicketsDetail(int id) { tickets recv = new tickets(); try { string path = "api/tickets/" + id; string url = BaseUri + path; return(GetEntityDetail <tickets>(url)); } catch (Exception ex) { string messgae = ex.Message; } return(recv); }
// GET: tickets/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tickets tickets = db.tickets.Find(id); if (tickets == null) { return(HttpNotFound()); } ViewBag.Soporte = new SelectList(db.precios, "precio", "precio", tickets.Soporte); ViewBag.Requerimiento = new SelectList(db.precios, "precio", "precio", tickets.Requerimiento); ViewBag.Incidencias = new SelectList(db.precios, "precio", "precio", tickets.Incidencias); return(View(tickets)); }
public bool Insertar(tickets entidad) { SqlCommand cmd = new SqlCommand(); bool respuesta = false; try { AbrirConexion(); cmd.Connection = Conexion; cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "DML_Tickets"; cmd.Parameters.AddWithValue("@Sentencia", "Insert"); cmd.Parameters.AddWithValue("@IdTicket", entidad.id_ticket); cmd.Parameters.AddWithValue("@IdUsuario", entidad.id_usuario); cmd.Parameters.AddWithValue("@IdSucursal", entidad.id_sucursal); cmd.Parameters.AddWithValue("@asunto", entidad.asunto); cmd.Parameters.AddWithValue("@descripcion", entidad.descripcion); if (entidad.imagen != string.Empty) { cmd.Parameters.AddWithValue("@imagen", Convert.FromBase64String(entidad.imagen)); } cmd.ExecuteNonQuery(); respuesta = true; } catch (InvalidCastException ex) { ApplicationException excepcion = new ApplicationException("Se genero un error de conversión de tipos con el siguiente mensaje: " + ex.Message, ex); excepcion.Source = "Insertar tickets"; throw excepcion; } catch (Exception ex) { ApplicationException excepcion = new ApplicationException("Se genero un error de aplicación con el siguiente mensaje: " + ex.Message, ex); excepcion.Source = "Insertar tickets"; throw excepcion; } finally { CerrarConexion(); cmd = null; } return(respuesta); }
public ActionResult Guardar_EnMA(tickets entidad) { var r = false; try { if (entidad.id_ticket > 0) { entidad.id_sucursal = ctrlUsuarios.Obtener(entidad.id_usuario).id_sucursal; r = control.Actualizar(entidad); r = ctrlDetalle.Actualizar(entidad); } else { entidad.id_sucursal = ctrlUsuarios.Obtener(entidad.id_usuario).id_sucursal; r = control.Insertar(entidad); int id_ticket = control.ObtenerMax(); ctrlDetalle.Insertar(new detalle_ticket { id_ticket = id_ticket, id_area = entidad.id_area, id_prioridad = entidad.id_prioridad, id_estado = entidad.id_estado, id_agente = entidad.id_agente, id_tipo_soporte = entidad.id_tipo_soporte, }); } if (!r) { return(Json("Error al realizar la operacion", JsonRequestBehavior.AllowGet)); } return(Json("Realizado", JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(View("Error", new HandleErrorInfo(ex, "TipoUsuario", "Create"))); } }
public ActionResult Guardar(tickets entidad) { var r = false; try { if (entidad.id_ticket > 0) { r = control.Actualizar(entidad); } else { r = control.Insertar(entidad); int id_ticket = control.ObtenerMax(); int id_prioridad = (ctrlPrioridad.ObtenerTodos().Find(x => x.nombre.ToUpper() == "BAJA") as prioridad).id_prioridad; int id_estado = (ctrlEstado.ObtenerTodos().Find(x => x.nombre.ToUpper() == "ABIERTO") as estado).id_estado; ctrlDetalle.InsertarPorSucursal(new detalle_ticket { id_ticket = id_ticket, id_prioridad = id_prioridad, id_estado = id_estado }); } if (!r) { return(Json("Error al realizar la operacion", JsonRequestBehavior.AllowGet)); } return(Json("Realizado", JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(View("Error", new HandleErrorInfo(ex, "TipoUsuario", "Create"))); } }
//获取指定的两票详情 public ActionResult GetDetail(int id) { tickets recv = client.GetTicketsDetail(id); return(View(recv)); }
public bool Insertar(tickets Entidad) { return(PerTickets.Insertar(Entidad)); }
public bool Actualizar(tickets Entidad) { return(PerTickets.Update(Entidad)); }
public List <tickets> ObtenerPorUsuario(int id) { List <tickets> lista = new List <tickets>(); tickets entidad = new tickets(); try { AbrirConexion(); StringBuilder CadenaSql = new StringBuilder(); SqlCommand comandoSelect = new SqlCommand(); comandoSelect.Connection = Conexion; comandoSelect.CommandType = CommandType.StoredProcedure; comandoSelect.CommandText = "DML_Tickets"; comandoSelect.Parameters.AddWithValue("@Sentencia", "Select"); comandoSelect.Parameters.AddWithValue("@IdUsuario", id); using (var dr = comandoSelect.ExecuteReader()) { while (dr.Read()) { entidad = new tickets(); entidad.id_ticket = int.Parse(dr["id_ticket"].ToString()); entidad.id_usuario = int.Parse(dr["id_usuario"].ToString()); entidad.usuario = dr["usuario"].ToString(); if (dr["foto_usuario"].ToString() != string.Empty) { entidad.foto_usuario = "data:image/png;base64," + Convert.ToBase64String((byte[])dr["foto_usuario"]); } entidad.id_sucursal = int.Parse(dr["id_sucursal"].ToString()); entidad.sucursal = dr["sucursal"].ToString(); entidad.asunto = dr["asunto"].ToString(); entidad.descripcion = dr["descripcion"].ToString(); if (dr["imagen"].ToString() != string.Empty) { entidad.imagen = "data:image/png;base64," + Convert.ToBase64String((byte[])dr["imagen"]); } entidad.fechahora_creacion = dr["fechahora_creacion"].ToString(); entidad.id_estado = int.Parse(dr["id_estado"].ToString()); entidad.estado = dr["estado"].ToString(); if (dr["id_detalle_ticket"].ToString() != string.Empty) { entidad.id_detalle_ticket = int.Parse(dr["id_detalle_ticket"].ToString()); entidad.id_prioridad = int.Parse(dr["id_prioridad"].ToString()); entidad.prioridad = dr["prioridad"].ToString(); entidad.id_agente = dr["id_agente"].ToString() == string.Empty ? 0 : int.Parse(dr["id_agente"].ToString()); entidad.agente = dr["agente"].ToString() == "" ? "Sin Asignar" : dr["agente"].ToString(); if (dr["foto_agente"].ToString() != string.Empty) { entidad.foto_agente = "data:image/png;base64," + Convert.ToBase64String((byte[])dr["foto_agente"]); } entidad.id_area = dr["id_area"].ToString() == string.Empty ? 0 : int.Parse(dr["id_area"].ToString()); entidad.area = dr["area"].ToString(); entidad.id_tipo_soporte = dr["id_tipo_soporte"].ToString() == string.Empty ? 0 : int.Parse(dr["id_tipo_soporte"].ToString()); entidad.tipo_soporte = dr["tipo_soporte"].ToString(); } lista.Add(entidad); } } } catch (InvalidCastException ex) { ApplicationException excepcion = new ApplicationException("Se genero un error de conversión de tipos con el siguiente mensaje: " + ex.Message, ex); excepcion.Source = "Insertar tickets"; throw excepcion; } catch (Exception ex) { ApplicationException excepcion = new ApplicationException("Se genero un error de aplicación con el siguiente mensaje: " + ex.Message, ex); excepcion.Source = "Insertar tickets"; throw excepcion; } finally { CerrarConexion(); } return(lista); }
private void BtnSave_Click(object sender, RoutedEventArgs e) { StringBuilder errors = new StringBuilder(); if (mode != "Edit") { _newTickets.tourId = 0; _newTickets.clientId = 0; _newTickets.staffId = 0; StackPanel sp = (StackPanel)tourscroll.Content; foreach (RadioButton r in sp.Children) { if (r.IsChecked == true) { _newTickets.tourId = (int)r.Tag; } } sp = (StackPanel)clientscroll.Content; foreach (RadioButton r in sp.Children) { if (r.IsChecked == true) { _newTickets.clientId = (int)r.Tag; } } sp = (StackPanel)staffscroll.Content; foreach (RadioButton r in sp.Children) { if (r.IsChecked == true) { _newTickets.staffId = (int)r.Tag; } } if (_newTickets.tourId == 0) { errors.AppendLine("Выберите тур"); } if (_newTickets.clientId == 0) { errors.AppendLine("Выберите клиента"); } if (_newTickets.staffId == 0) { errors.AppendLine("Выберите сотрудника"); } if (errors.Length > 0) { MessageBox.Show(errors.ToString()); return; } else { tours t = TE.tours.Find(_newTickets.tourId); t.ticketQnt -= 1; TE.tickets.Add(_newTickets); } } else { tickets tt = TE.tickets.Find(_newTickets.ticketId); tt.tourId = _newTickets.tourId; tt.clientId = _newTickets.clientId; tt.staffId = _newTickets.staffId; } try { TE.SaveChanges(); MessageBox.Show("Информация сохранена"); Manager.MainFrame.GoBack(); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } }
public AddEditticket(tickets selectedtickets) { InitializeComponent(); _newTickets = new tickets(); if (selectedtickets != null) { _newTickets = selectedtickets; mode = "Edit"; StackPanel sp = new StackPanel(); foreach (tours t in TE.tours) { RadioButton r = new RadioButton(); r.Content = t.tourId; r.Tag = t.tourId; r.GroupName = "tour"; if (_newTickets.tourId == (int)r.Tag) { r.IsChecked = true; } r.IsEnabled = false; sp.Children.Add(r); } tourscroll.Content = sp; sp = new StackPanel(); foreach (clients c in TE.clients) { RadioButton r = new RadioButton(); r.Content = c.lname; r.Tag = c.clientId; r.GroupName = "client"; if (_newTickets.clientId == (int)r.Tag) { r.IsChecked = true; } sp.Children.Add(r); } clientscroll.Content = sp; sp = new StackPanel(); foreach (staffs s in TE.staffs) { RadioButton r = new RadioButton(); r.Content = s.lname; r.Tag = s.staffId; r.GroupName = "staff"; if (_newTickets.staffId == (int)r.Tag) { r.IsChecked = true; } sp.Children.Add(r); } staffscroll.Content = sp; } else { StackPanel sp = new StackPanel(); foreach (tours t in TE.tours) { RadioButton r = new RadioButton(); r.Content = t.tourId; r.Tag = t.tourId; r.GroupName = "tour"; sp.Children.Add(r); } tourscroll.Content = sp; sp = new StackPanel(); foreach (clients c in TE.clients) { RadioButton r = new RadioButton(); r.Content = c.lname; r.Tag = c.clientId; r.GroupName = "client"; sp.Children.Add(r); } clientscroll.Content = sp; sp = new StackPanel(); foreach (staffs s in TE.staffs) { RadioButton r = new RadioButton(); r.Content = s.lname; r.Tag = s.staffId; r.GroupName = "staff"; sp.Children.Add(r); } staffscroll.Content = sp; _newTickets.ticketId = -1; foreach (tickets tt in TE.tickets) { if (_newTickets.ticketId < tt.ticketId) { _newTickets.ticketId = tt.ticketId + 1; } if (_newTickets.ticketId == tt.ticketId) { _newTickets.ticketId += 1; } } } DataContext = _newTickets; }
public informesController(tickets contexto) { _contexto = contexto; }