123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- using System;
- using System.Collections.Generic;
- using System.Web;
- using System.Data;
- namespace Com.Jpsoft.Hospital.Web.Module.EmployeeGroup
- {
- /// <summary>
- /// GetData 的摘要说明
- /// </summary>
- public class GetData : IHttpHandler
- {
- public void ProcessRequest(HttpContext context)
- {
- string act;
- if (!string.IsNullOrEmpty(context.Request.QueryString["act"]))
- {
- act = context.Request.QueryString["act"];
- switch (act)
- {
- case "getBMList":
- GetBMList(context);
- break;
- case "getEmployeeList":
- GetEmployeeList(context);
- break;
- case "postData":
- PostData(context);
- break;
- case "delData":
- DelData(context);
- break;
- }
- }
- }
- private void GetBMList(HttpContext context)
- {
- System.Text.StringBuilder html = new System.Text.StringBuilder();
- Com.Jpsoft.Hospital.BLL.rs_ksdm ksdm = new BLL.rs_ksdm();
- DataTable dt = ksdm.GetAllList().Tables[0];
- foreach (DataRow row in dt.Rows)
- {
- html.AppendFormat("<table class='dd' style='width:95%' border=\"0\" cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"#006699\"><tr bgcolor=\"#006699\"><td width=\"95%\"><a href='#' onclick=\"hve_display('table_{0}')\" style=\"cursor: hand\"><font color='black'><b>{1}</b></font></a></td></tr></table>", row["ksdm"].ToString(), row["ksmc"].ToString());
- html.AppendFormat("<table ID='table_{0}' style='width:95%' border='0' cellspacing='1' cellpadding='0' bgcolor='#006699' style='display:none'></table>", row["ksdm"].ToString());
-
- }
- context.Response.ContentType = "text/plain";
- context.Response.Write(html.ToString());
- }
- private void GetEmployeeList(HttpContext context)
- {
- System.Text.StringBuilder html = new System.Text.StringBuilder();
- //Com.Jpsoft.Hospital.BLL.rs_ygxx ygxx = new BLL.rs_ygxx();
- Com.Jpsoft.Hospital.BLL.jp_employee_group_detailEx detailEx = new BLL.jp_employee_group_detailEx();
- string id = context.Request.QueryString["id"].Split('_')[1];
- string gid = context.Request.QueryString["gid"];
- DataTable dt = detailEx.GetNotExistEmployee(gid, id).Tables[0];//ygxx.GetList(" ksdm=" + id).Tables[0];
- int rowCount = 0;
- foreach (DataRow row in dt.Rows)
- {
- if (rowCount == 0)
- {
- html.Append("<tr bgcolor='#FFFFFF'>");
- }
- html.AppendFormat("<td bgcolor='#7AACFE'><input type='checkbox' did='{0}'>{1}</td>", row["ygdm"].ToString(), row["ygxm"].ToString());
- rowCount++;
- if (rowCount == 5)
- {
- rowCount = 0;
- html.Append("</tr>");
- }
- }
- context.Response.ContentType = "text/plain";
- context.Response.Write(html.ToString());
- }
- private void PostData(HttpContext context)
- {
- string result;
- string id = context.Request.QueryString["ids"];
- string gid = context.Request.QueryString["gid"];
- Com.Jpsoft.Hospital.BLL.jp_employee_group_detailEx detailEx = new BLL.jp_employee_group_detailEx();
- if (detailEx.Add2(id,gid))
- result = "1";
- else
- result = "0";
- context.Response.ContentType = "text/plain";
- context.Response.Write(result);
- }
- private void DelData(HttpContext context)
- {
- string result = "0";
- string id = context.Request.QueryString["id"];
- Com.Jpsoft.Hospital.BLL.jp_employee_group_detailEx detailEx = new BLL.jp_employee_group_detailEx();
- if (detailEx.Delete(int.Parse(id)))
- result = "1";
- context.Response.ContentType = "text/plain";
- context.Response.Write(result);
- }
- public bool IsReusable
- {
- get
- {
- return false;
- }
- }
- }
- }
|