本文整理汇总了C#中Service1Client.getTbl_departamentos方法的典型用法代码示例。如果您正苦于以下问题:C# Service1Client.getTbl_departamentos方法的具体用法?C# Service1Client.getTbl_departamentos怎么用?C# Service1Client.getTbl_departamentos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Service1Client
的用法示例。
在下文中一共展示了Service1Client.getTbl_departamentos方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddJefe
// GET: Jerarquia
public ActionResult AddJefe()
{
if (Session["User"] != null)
{
Service1Client client = new Service1Client();
var query = client.getTbl_usuarios();
List<string> emple = new List<string>();
foreach (var item in query)
{
emple.Add(item.primer_nombre + " " + item.primer_apellido + "|" + item.talento_humano);
}
ViewBag.Empleados = emple;
var quer = client.getTbl_departamentos();
List<string> depto = new List<string>();
foreach (var item in quer)
{
depto.Add(item.descripcion+ "|" + item.departamentoid);
}
client.Close();
ViewBag.Empleados = emple;
ViewBag.Departamentos = depto;
return View();
}
else
return RedirectToAction("Login", "Home");
}
示例2: getJefe_Departamanto
public ActionResult getJefe_Departamanto()
{
string json = "";
Service1Client client = new Service1Client();
var depto = client.getTbl_departamentos();
for (int i = 0; i < depto.Count(); i++)
{
if (!json.Equals("")) { json += ","; }
int deptoid = depto.ElementAt(i).departamentoid;
string jefe = client.getJefe_Departamento(deptoid);
json += "{" + String.Format("\"departamento\":\"{0}\",\"nombre\":\"{1}\"", depto.ElementAt(i).descripcion, jefe) + "}";
}
json = "{\"draw\": 1,\"recordsTotal\": 1,\"recordsFiltered\": 1,\"data\": [" + json + "]}";
return Content(json);
}
示例3: JSonDepartamentos
public ActionResult JSonDepartamentos()
{
string json = "";
Service1Client client = new Service1Client();
var query = client.getTbl_departamentos();
if (query == null)
{
json += "{" + String.Format("\"id\":\"{0}\",\"descripcion\":\"{1}\"", "0", "Null") + "}";
json = "{\"draw\": 1,\"recordsTotal\": 1,\"recordsFiltered\": 1,\"data\": [" + json + "]}";
return Content(json);
}
for (int i = 0; i < query.Count(); i++)
{
if (!json.Equals("")) { json += ","; }
json += "{" + String.Format("\"id\":\"{0}\",\"descripcion\":\"{1}\"", query.ElementAt(i).departamentoid, query.ElementAt(i).descripcion) + "}";
}
json = "{\"draw\": 1,\"recordsTotal\": 1,\"recordsFiltered\": 1,\"data\": [" + json + "]}";
return Content(json);
}