public ActionResult Edit(Cliente_ApellidoEntity objCliente_Apellido) { if (ModelState.IsValid) { objCliente_Apellido.BaseRemoteIp = RemoteIp; objCliente_Apellido.BaseIdUser = LoggedUserName; int result = proxy.UpdateCliente_Apellido(objCliente_Apellido); if (result == -1) { Cliente_ApellidoEntity objCliente_ApellidoOld = proxy.GetCliente_Apellido(objCliente_Apellido.Contrato); AssingMessageScript("El Cliente_Apellido ya existe en el sistema, .", "error", "Error", true); CheckNotify(); return(View(objCliente_Apellido)); } if (result > 0) { AssingMessageScript("El Cliente_Apellido se modifico en el sistema.", "success", "Éxito", true); CheckNotify(); return(RedirectToAction("Index")); } return(RedirectToAction("Index")); } return(View(objCliente_Apellido)); }
public ActionResult Details(int id = 0) { Cliente_ApellidoEntity objCliente_Apellido = proxy.GetCliente_Apellido(id); if (objCliente_Apellido == null) { return(HttpNotFound()); } return(PartialView(objCliente_Apellido)); }
public ActionResult Edit(int id = 0) { PermisosAccesoDeniedEdit("Cliente_Apellido"); ViewBag.CustomScriptsPageValid = BuildScriptPageValid(); Cliente_ApellidoEntity objCliente_Apellido = proxy.GetCliente_Apellido(id); if (objCliente_Apellido == null) { return(HttpNotFound()); } return(View(objCliente_Apellido)); }
/// <summary> /// Edits a Cliente_Apellido ///</summary> /// <param name="Cliente_Apellido"> Objeto Cliente_Apellido a editar </param> public override int EditCliente_Apellido(Cliente_ApellidoEntity entity_Cliente_Apellido) { int result = 0; using (SqlConnection connection = new SqlConnection(SoftvSettings.Settings.Cliente_Apellido.ConnectionString)) { SqlCommand comandoSql = CreateCommand("Softv_Cliente_ApellidoEdit", connection); AssingParameter(comandoSql, "@Contrato", entity_Cliente_Apellido.Contrato); AssingParameter(comandoSql, "@Nombre", entity_Cliente_Apellido.Nombre); AssingParameter(comandoSql, "@SegundoNombre", entity_Cliente_Apellido.SegundoNombre); AssingParameter(comandoSql, "@Apellido_Paterno", entity_Cliente_Apellido.Apellido_Paterno); AssingParameter(comandoSql, "@Apellido_Materno", entity_Cliente_Apellido.Apellido_Materno); AssingParameter(comandoSql, "@FechaNacimiento", entity_Cliente_Apellido.FechaNacimiento); AssingParameter(comandoSql, "@RFC", entity_Cliente_Apellido.RFC); AssingParameter(comandoSql, "@EsFisica", entity_Cliente_Apellido.EsFisica); try { if (connection.State == ConnectionState.Closed) { connection.Open(); } result = int.Parse(ExecuteNonQuery(comandoSql).ToString()); } catch (Exception ex) { throw new Exception("Error updating Cliente_Apellido " + ex.Message, ex); } finally { if (connection != null) { connection.Close(); } } } return(result); }
/// <summary> ///</summary> /// <param name="Cliente_Apellido"> Object Cliente_Apellido added to List</param> public override int AddCliente_Apellido(Cliente_ApellidoEntity entity_Cliente_Apellido) { int result = 0; using (SqlConnection connection = new SqlConnection(SoftvSettings.Settings.Cliente_Apellido.ConnectionString)) { SqlCommand comandoSql = CreateCommand("Softv_Cliente_ApellidoAdd", connection); AssingParameter(comandoSql, "@Contrato", null, pd: ParameterDirection.Output, IsKey: true); AssingParameter(comandoSql, "@Nombre", entity_Cliente_Apellido.Nombre); AssingParameter(comandoSql, "@SegundoNombre", entity_Cliente_Apellido.SegundoNombre); AssingParameter(comandoSql, "@Apellido_Paterno", entity_Cliente_Apellido.Apellido_Paterno); AssingParameter(comandoSql, "@Apellido_Materno", entity_Cliente_Apellido.Apellido_Materno); AssingParameter(comandoSql, "@FechaNacimiento", entity_Cliente_Apellido.FechaNacimiento); AssingParameter(comandoSql, "@RFC", entity_Cliente_Apellido.RFC); AssingParameter(comandoSql, "@EsFisica", entity_Cliente_Apellido.EsFisica); try { if (connection.State == ConnectionState.Closed) { connection.Open(); } result = ExecuteNonQuery(comandoSql); } catch (Exception ex) { throw new Exception("Error adding Cliente_Apellido " + ex.Message, ex); } finally { connection.Close(); } result = (int)comandoSql.Parameters["@Contrato"].Value; } return(result); }
/// <summary> /// Gets Cliente_Apellido by ///</summary> public override Cliente_ApellidoEntity GetCliente_ApellidoById(long?Contrato) { using (SqlConnection connection = new SqlConnection(SoftvSettings.Settings.Cliente_Apellido.ConnectionString)) { SqlCommand comandoSql = CreateCommand("Softv_Cliente_ApellidoGetById", connection); Cliente_ApellidoEntity entity_Cliente_Apellido = null; AssingParameter(comandoSql, "@Contrato", Contrato); IDataReader rd = null; try { if (connection.State == ConnectionState.Closed) { connection.Open(); } rd = ExecuteReader(comandoSql, CommandBehavior.SingleRow); if (rd.Read()) { entity_Cliente_Apellido = GetCliente_ApellidoFromReader(rd); } } catch (Exception ex) { throw new Exception("Error getting data Cliente_Apellido " + ex.Message, ex); } finally { if (connection != null) { connection.Close(); } if (rd != null) { rd.Close(); } } return(entity_Cliente_Apellido); } }
public ActionResult Create(Cliente_ApellidoEntity objCliente_Apellido) { if (ModelState.IsValid) { objCliente_Apellido.BaseRemoteIp = RemoteIp; objCliente_Apellido.BaseIdUser = LoggedUserName; int result = proxy.AddCliente_Apellido(objCliente_Apellido); if (result == -1) { AssingMessageScript("El Cliente_Apellido ya existe en el sistema.", "error", "Error", true); CheckNotify(); return(View(objCliente_Apellido)); } if (result > 0) { AssingMessageScript("Se dio de alta el Cliente_Apellido en el sistema.", "success", "Éxito", true); return(RedirectToAction("Index")); } } return(View(objCliente_Apellido)); }
/// <summary> /// Converts data from reader to entity /// </summary> protected virtual Cliente_ApellidoEntity GetCliente_ApellidoFromReader(IDataReader reader) { Cliente_ApellidoEntity entity_Cliente_Apellido = null; try { entity_Cliente_Apellido = new Cliente_ApellidoEntity(); entity_Cliente_Apellido.Contrato = (long?)(GetFromReader(reader, "Contrato")); entity_Cliente_Apellido.Nombre = (String)(GetFromReader(reader, "Nombre", IsString: true)); entity_Cliente_Apellido.SegundoNombre = (String)(GetFromReader(reader, "SegundoNombre", IsString: true)); entity_Cliente_Apellido.Apellido_Paterno = (String)(GetFromReader(reader, "Apellido_Paterno", IsString: true)); entity_Cliente_Apellido.Apellido_Materno = (String)(GetFromReader(reader, "Apellido_Materno", IsString: true)); entity_Cliente_Apellido.FechaNacimiento = (DateTime?)(GetFromReader(reader, "FechaNacimiento")); entity_Cliente_Apellido.RFC = (String)(GetFromReader(reader, "RFC", IsString: true)); entity_Cliente_Apellido.EsFisica = (bool?)(GetFromReader(reader, "EsFisica")); } catch (Exception ex) { throw new Exception("Error converting Cliente_Apellido data to entity", ex); } return(entity_Cliente_Apellido); }
public static Cliente_ApellidoEntity GetOne(long?Contrato) { Cliente_ApellidoEntity result = ProviderSoftv.Cliente_Apellido.GetCliente_ApellidoById(Contrato); return(result); }
public static int Edit(Cliente_ApellidoEntity objCliente_Apellido) { int result = ProviderSoftv.Cliente_Apellido.EditCliente_Apellido(objCliente_Apellido); return(result); }
public int UpdateCliente_Apellido(Cliente_ApellidoEntity objCliente_Apellido) { return(Cliente_Apellido.Edit(objCliente_Apellido)); }
public int AddCliente_Apellido(Cliente_ApellidoEntity objCliente_Apellido) { return(Cliente_Apellido.Add(objCliente_Apellido)); }
/// <summary> /// Abstract method to update Cliente_Apellido /// </summary> public abstract int EditCliente_Apellido(Cliente_ApellidoEntity entity_Cliente_Apellido);
public ActionResult QuickIndex(int?page, int?pageSize, String Nombre, String SegundoNombre, String Apellido_Paterno, String Apellido_Materno, DateTime?FechaNacimiento, String RFC, bool?EsFisica) { int pageNumber = (page ?? 1); int pSize = pageSize ?? SoftvMVC.Properties.Settings.Default.pagnum; SoftvList <Cliente_ApellidoEntity> listResult = null; List <Cliente_ApellidoEntity> listCliente_Apellido = new List <Cliente_ApellidoEntity>(); Cliente_ApellidoEntity objCliente_Apellido = new Cliente_ApellidoEntity(); Cliente_ApellidoEntity objGetCliente_Apellido = new Cliente_ApellidoEntity(); if ((Nombre != null && Nombre.ToString() != "")) { objCliente_Apellido.Nombre = Nombre; } if ((SegundoNombre != null && SegundoNombre.ToString() != "")) { objCliente_Apellido.SegundoNombre = SegundoNombre; } if ((Apellido_Paterno != null && Apellido_Paterno.ToString() != "")) { objCliente_Apellido.Apellido_Paterno = Apellido_Paterno; } if ((Apellido_Materno != null && Apellido_Materno.ToString() != "")) { objCliente_Apellido.Apellido_Materno = Apellido_Materno; } if ((FechaNacimiento != null)) { objCliente_Apellido.FechaNacimiento = FechaNacimiento; } if ((RFC != null && RFC.ToString() != "")) { objCliente_Apellido.RFC = RFC; } if ((EsFisica != null)) { objCliente_Apellido.EsFisica = EsFisica; } pageNumber = pageNumber == 0 ? 1 : pageNumber; listResult = proxy.GetCliente_ApellidoPagedListXml(pageNumber, pSize, Globals.SerializeTool.Serialize(objCliente_Apellido)); if (listResult.Count == 0) { int tempPageNumber = (int)(listResult.totalCount / pSize); pageNumber = (int)(listResult.totalCount / pSize) == 0 ? 1 : tempPageNumber; listResult = proxy.GetCliente_ApellidoPagedListXml(pageNumber, pSize, Globals.SerializeTool.Serialize(objCliente_Apellido)); } listResult.ToList().ForEach(x => listCliente_Apellido.Add(x)); var Cliente_ApellidoAsIPagedList = new StaticPagedList <Cliente_ApellidoEntity>(listCliente_Apellido, pageNumber, pSize, listResult.totalCount); if (Cliente_ApellidoAsIPagedList.Count > 0) { return(PartialView(Cliente_ApellidoAsIPagedList)); } else { var result = new { tipomsj = "warning", titulomsj = "Aviso", Success = "False", Message = "No se encontraron registros con los criterios de búsqueda ingresados." }; return(Json(result, JsonRequestBehavior.AllowGet)); } }