public dotNetFlexGrid.DataHandlerResult DotNetFlexGrid1DataHandler(dotNetFlexGrid.DataHandlerParams p) { dotNetFlexGrid.DataHandlerResult result = new dotNetFlexGrid.DataHandlerResult(); result.page = p.page; //设定当前返回的页号 result.total = 100; //总计的数据条数,此处用100进行模拟,查询和筛选时需要根据实际 // result.table = dotNetFlexGrid.DemoMemoryTable(p.page * 100, p.rp);//调用演示的数据生成函数产生模拟数据 //如果传递的参数包含排序设置的话,通过DataView.Sort功能模拟进行当页排序 string tisaneid = "0"; if (p.extParam.ContainsKey("tisaneid")) { tisaneid = p.extParam["tisaneid"]; } string tisaneman = "0"; if (p.extParam.ContainsKey("tisaneman")) { tisaneman = p.extParam["tisaneman"]; } string STime = ""; if (p.extParam.ContainsKey("STime")) { STime = p.extParam["STime"]; } string ETime = ""; if (p.extParam.ContainsKey("ETime")) { ETime = p.extParam["ETime"]; } string tisanestatus = "0"; if (p.extParam.ContainsKey("tisanestatus")) { tisanestatus = p.extParam["tisanestatus"]; } string tisanemethod = "0"; if (p.extParam.ContainsKey("tisanemethod")) { tisanemethod = p.extParam["tisanemethod"]; } if (tisaneid == "") { tisaneid = "0"; } if (tisaneman == "") { tisaneman = "0"; } TeModel tm = new TeModel(); // result.table = tm.queryTisaneInfo(Convert.ToInt32(tisaneid), tisaneman, tisanestatus, tisanemethod, tisanetime); result.table = tm.queryTisaneInfo(Convert.ToInt32(tisaneid), tisaneman, Convert.ToInt32(tisanestatus), Convert.ToInt32(tisanemethod), STime, ETime); dotNetFlexGrid.FieldFormatorHandle proc = delegate(DataRow dr) { string a = ""; int tstatus = Convert.ToInt32(dr["tisanestatus"].ToString()); if (tstatus == 0) { a = "开始煎药"; } else if (tstatus == 1) { a = "煎药完成"; } return(a); }; result.FieldFormator.Register("tisanestatus", proc); dotNetFlexGrid.FieldFormatorHandle proc1 = delegate(DataRow dr) { int bstatus = Convert.ToInt32(dr["bubblestatus"].ToString()); if (bstatus == 1) { return("泡药完成"); } else { return("开始泡药"); } }; // dotNetFlexGrid.FieldFormatorHandle proc1a = delegate(DataRow dr) { string z = ""; int bstatus = Convert.ToInt32(dr["tisanestatus"].ToString()); string start = dr["starttime"].ToString(); if (bstatus == 0) { System.DateTime currentTime = new System.DateTime(); currentTime = System.DateTime.Now; string strtime = currentTime.ToString("yyyy-MM-dd HH:mm:ss"); // DateTime d1 = Convert.ToDateTime(strtime); //当前时间 DateTime d2 = Convert.ToDateTime(start); //开始时间 TimeSpan d3 = d1.Subtract(d2); //泡药时间 int dT = Convert.ToInt32(d3.Days.ToString()) * 24 * 60 + Convert.ToInt32(d3.Hours.ToString()) * 60 + Convert.ToInt32(d3.Minutes.ToString()); //转化为分钟数 string dt = dT.ToString(); z = dt; } else { z = dr["tisanetime"].ToString(); } return(z); }; result.FieldFormator.Register("tisanetime", proc1a); dotNetFlexGrid.FieldFormatorHandle proc2 = delegate(DataRow dr) { int a = Convert.ToInt32(dr["sex"].ToString()); if (a == 1) { return("男"); } else { return("女"); } }; result.FieldFormator.Register("sex", proc2); dotNetFlexGrid.FieldFormatorHandle proc3 = delegate(DataRow dr) { int b = Convert.ToInt32(dr["decscheme"].ToString()); if (b == 1) { return("微压(密闭)解表(15min)"); } else if (b == 2) { return("微压(密闭)汤药(15min)"); } else if (b == 3) { return("微压(密闭)补药(15min)"); } else if (b == 4) { return("常压解表(10min,10min)"); } else if (b == 5) { return("常压汤药(20min,15min)"); } else if (b == 6) { return("常压补药(25min,20min)"); } else if (b == 20) { return("先煎解表(10min,10min,10min)"); } else if (b == 21) { return("先煎汤药(10min,20min,15min)"); } else if (b == 22) { return("先煎补药(10min,25min,20min)"); } else if (b == 36) { return("后下解表(10min(3:7),10min)"); } else if (b == 37) { return("后下汤药(20min(13:7),15min)"); } else if (b == 38) { return("后下补药(25min(18:7),20min)"); } else if (b == 81) { return("微压自定义"); } else if (b == 82) { return("常压自定义"); } else if (b == 83) { return("先煎自定义"); } else { return("后下自定义"); } }; result.FieldFormator.Register("decscheme", proc3); dotNetFlexGrid.FieldFormatorHandle proc4 = delegate(DataRow dr) { int a = Convert.ToInt32(dr["decmothed"].ToString()); if (a == 1) { return("先煎"); } else if (a == 2) { return("后下"); } else { return("加糖加蜜"); } }; result.FieldFormator.Register("decmothed", proc4); dotNetFlexGrid.FieldFormatorHandle proc6 = delegate(DataRow dr) { int a = Convert.ToInt32(dr["takeway"].ToString()); if (a == 1) { return("水煎餐后"); } else { return(""); } }; result.FieldFormator.Register("takeway", proc6); dotNetFlexGrid.FieldFormatorHandle proc5 = delegate(DataRow dr) { int a = Convert.ToInt32(dr["dtbtype"].ToString()); if (a == 1) { return("顺丰"); } else if (a == 2) { return("圆通"); } else { return("中通"); } }; result.FieldFormator.Register("dtbtype", proc5); return(result); }