public static string EstadosDataBind(string claPais) { List <Entities.Estado> list = new List <Estado>(); Business.Estados bo = new Business.Estados(); list = bo.Combo(Utils.IsNull(claPais, -1)); System.Web.Script.Serialization.JavaScriptSerializer js = new System.Web.Script.Serialization.JavaScriptSerializer(); return(js.Serialize(list)); }
public static string GetEntityForEdition(string id) { System.Web.Script.Serialization.JavaScriptSerializer js = new System.Web.Script.Serialization.JavaScriptSerializer(); Business.Estados bo = new Business.Estados(); Entities.Estado entity = new Entities.Estado(); entity.ID = Utils.IsNull(id, 0); entity.SetFromDataSource(true); bo.PrepareEntityForEdition(entity); return(js.Serialize(entity)); }
public static string Eliminar(string[] ids) { Business.Estados bo = new Business.Estados(); List <Exception> list = bo.Eliminar(ids); if (list.Count > 0) { string errores = ""; foreach (Exception ex in list) { errores += ex.Message; } return("No se pudieron eliminar algunos registros " + errores); } return(""); }
public static void Guardar(string action, string id, string nombre) { Entities.Estado item; if (action.ToLower() == "add") { item = new Estado(); } else { item = new Estado(true); } item.ID = Utils.IsNull(id, 0); item.Nombre = nombre; Business.Estados bo = new Business.Estados(); bo.Save(item); }
public static string GetData() { System.Web.Script.Serialization.JavaScriptSerializer js = new System.Web.Script.Serialization.JavaScriptSerializer(); string nomPuesto = HttpContext.Current.Request.QueryString.Get("nomEstado"); JQXGridSettings settings = JsonGridData.GetGridSettings(); Business.Estados bo = new Business.Estados(); List <Entities.Estado> list = bo.ListarEstados(settings, 0, ""); int registros = 0; if (list.Count > 0) { registros = list[0].TotalRecords; } JsonGridData data = new JsonGridData(list, registros); string json = js.Serialize(data); return(json); }