예제 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         //加载信息
         BLL.HKSJ_Employees employees = new BLL.HKSJ_Employees();
         //Empoyees = employees.GetModelList(string.Empty);
         //分页
         int pageIndex  = Request["pageIndex"] == null ? 1 : Convert.ToInt32(Request["pageIndex"]);
         int pageSize   = Request["pageSize"] == null ? 10 : Convert.ToInt32(Request["pageSize"]);
         int totalCount = employees.GetRecordCount(string.Empty);
         Empoyees = employees.DataTableToList(employees.GetListByPage(string.Empty, "id", (pageIndex - 1) * pageSize + 1, pageSize * pageIndex).Tables[0]);
         NavPager = Common.LaomaPager.ShowPageNavigate(pageSize, pageIndex, totalCount);
     }
 }
예제 #2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            //context.Response.Write("Hello World");
            int id = context.Request["relationShipID"] == null ? 0 : int.Parse(context.Request["relationShipID"]);

            BLL.HKSJ_Employees   bll   = new BLL.HKSJ_Employees();
            Model.HKSJ_Employees model = new Model.HKSJ_Employees();

            if (bll.Delete(id))
            {
                context.Response.Write("OK");
            }
            else
            {
                context.Response.Write("error");
            }
        }
예제 #3
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            //context.Response.Write("Hello World");

            BLL.HKSJ_Employees   bll   = new BLL.HKSJ_Employees();
            Model.HKSJ_Employees model = new Model.HKSJ_Employees();

            //ID, title, content, people, date, status, MainPeople
            //构造修改的参数
            //var updateEmployeesDate = {
            //ID: RowUpdateEmployeesID[0].ID,
            //title: $("#txtUpdatePosition").val(),
            //content: $("#txtUpdatePositionContent").val(),
            //people: $("#txtUpdateDemand").val(),
            //status: $("#txtUpdateState").val(),

            //Date: $('#txtUpdateDate').datebox('getValue'),
            //MainPeople: $("#txtUpdatePeople").val(),
            model.ID         = int.Parse(context.Request["ID"]);
            model.title      = context.Request["title"];
            model.content    = context.Request["content"];
            model.people     = context.Request["people"];
            model.status     = int.Parse(context.Request["status"]);
            model.MainPeople = context.Request["MainPeople"];
            model.date       = Convert.ToDateTime(context.Request["Date"]);


            if (bll.Update(model))
            {
                context.Response.Write("OK");
            }
            else
            {
                context.Response.Write("error");
            }
        }