public static dotNetFlexGrid.DataHandlerResult DemoDataHandler(dotNetFlexGrid.DataHandlerParams p) { dotNetFlexGrid.DataHandlerResult result = new dotNetFlexGrid.DataHandlerResult(); result.table = DemoMemoryTable(p.page * 100, p.rp); if (p.defaultSearch != null && p.defaultSearch.Count > 0) { string search = string.Empty; foreach (string key in p.defaultSearch.Keys) { search += "key=" + key + "|value=" + p.defaultSearch[key] + ";"; } result.table.Rows[0][1] = search; } if (p.qtype.Length > 0 && p.qop != dotNetFlexGrid.SerchParamConfigOperater.None && p.query.Length > 0) { DataView dv = result.table.DefaultView; dv.RowFilter = p.qtype + " " + ((p.qop == dotNetFlexGrid.SerchParamConfigOperater.Eq) ? "=" : "Like ") + " '%" + p.query + "%'"; result.table = dv.ToTable(); } if (p.sortname.Length > 0 && p.sortorder.Length > 0) { DataView dv = result.table.DefaultView; dv.Sort = (p.sortname + " " + p.sortorder); result.table = dv.ToTable(); } result.page = p.page; result.total = p.rp * 5;//模拟为5页 return(result); }
public dotNetFlexGrid.DataHandlerResult DotNetFlexGrid1DataHandler(dotNetFlexGrid.DataHandlerParams p) { dotNetFlexGrid.DataHandlerResult result = new dotNetFlexGrid.DataHandlerResult(); result.page = p.page; //设定当前返回的页号 result.total = 100; //总计的数据条数,此处用100进行模拟,查询和筛选时需要根据实际 DeliveryModel rm = new DeliveryModel(); result.table = rm.MedicineDisplayInfo(); dotNetFlexGrid.FieldFormatorHandle proc2 = delegate(DataRow dr) { int bstatus = Convert.ToInt32(dr["Sendstate"].ToString()); if (bstatus == 1) { return("已发货"); } else { return("待发货"); } }; result.FieldFormator.Register("Sendstate", proc2); return(result); }
public dotNetFlexGrid.DataHandlerResult FlexGridDrugDataHandler(dotNetFlexGrid.DataHandlerParams p) { dotNetFlexGrid.DataHandlerResult result = new dotNetFlexGrid.DataHandlerResult(); result.page = p.page; //设定当前返回的页号 result.total = 100; //总计的数据条数,此处用100进行模拟,查询和筛选时需要根据实际 DrugModel dm = new DrugModel(); string pspnum = "0"; string hospitalId = ""; if (p.extParam.ContainsKey("drugpspnum")) { pspnum = p.extParam["drugpspnum"]; } if (p.extParam.ContainsKey("hospitalId")) { hospitalId = p.extParam["hospitalId"]; } string pid = ""; if (p.extParam.ContainsKey("pid")) { pid = p.extParam["pid"]; } //result.table = dm.findNotMatchDrugByPspnum(pspnum, hospitalId); result.table = dm.findNotMatchDrugByPspnum(pid); return(result); }
public dotNetFlexGrid.DataHandlerResult FlexGridHospitalDataHandler(dotNetFlexGrid.DataHandlerParams p) { dotNetFlexGrid.DataHandlerResult result = new dotNetFlexGrid.DataHandlerResult(); result.page = p.page; //设定当前返回的页号 result.total = 100; //总计的数据条数,此处用100进行模拟,查询和筛选时需要根据实际 HospitalHandler hhandler = new HospitalHandler(); string hname = "0"; if (p.extParam.ContainsKey("hname")) { hname = p.extParam["hname"]; } string hnum = "0"; if (p.extParam.ContainsKey("hnum")) { hnum = p.extParam["hnum"]; } result.table = hhandler.SearchHospital(hname, hnum); return(result); }
public dotNetFlexGrid.DataHandlerResult DotNetFlexGrid1DataHandler(dotNetFlexGrid.DataHandlerParams p) { dotNetFlexGrid.DataHandlerResult result = new dotNetFlexGrid.DataHandlerResult(); result.page = p.page; //设定当前返回的页号 result.total = 100; //总计的数据条数,此处用100进行模拟,查询和筛选时需要根据实际 meRoomModel rm = new meRoomModel(); string unitnum = ""; if (p.extParam.ContainsKey("unitnum")) { unitnum = p.extParam["unitnum"]; } string roomnum = ""; if (p.extParam.ContainsKey("roomnum")) { roomnum = p.extParam["roomnum"]; } result.table = rm.DecoctingMonitoring(unitnum, roomnum); return(result); }
//提供数据的方法 public dotNetFlexGrid.DataHandlerResult DotNetFlexGrid1DataHandler(dotNetFlexGrid.DataHandlerParams p) { dotNetFlexGrid.DataHandlerResult result = new dotNetFlexGrid.DataHandlerResult(); result.page = p.page; //设定当前返回的页号 result.total = 100; //总计的数据条数,此处用100进行模拟,查询和筛选时需要根据实际 string fromid = "0"; if (p.extParam.ContainsKey("fromid")) { fromid = p.extParam["fromid"]; } if (fromid == "" || fromid == "0") { fromid = "0"; } StorageManageModel smm = new StorageManageModel(); result.table = smm.findStoragebyfromid(fromid); return(result); }
} //提供数据的方法 public dotNetFlexGrid.DataHandlerResult DotNetFlexGrid1DataHandler(dotNetFlexGrid.DataHandlerParams p) { dotNetFlexGrid.DataHandlerResult result = new dotNetFlexGrid.DataHandlerResult(); result.page = p.page; //设定当前返回的页号 result.total = 100; //总计的数据条数,此处用100进行模拟,查询和筛选时需要根据实际 WarehouseInvenModel rm = new WarehouseInvenModel(); //string Type = ""; //if (p.extParam.ContainsKey("Type")) //{ // Type = p.extParam["Type"]; //} string STime = ""; if (p.extParam.ContainsKey("STime")) { STime = p.extParam["STime"]; } string ETime = ""; if (p.extParam.ContainsKey("ETime")) { ETime = p.extParam["ETime"]; } int pageSize = p.rp; result.table = rm.finTransferInfor(STime, ETime); return(result); }
public dotNetFlexGrid.DataHandlerResult FlexGrid1DataHandler2(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); HospitalModel hm = new HospitalModel(); result.table = hm.findwarningtime("1"); dotNetFlexGrid.FieldFormatorHandle proc = delegate(DataRow dr) { if (dr["status"].ToString() == "1") { return("<span style='color:red'>开启</span>"); } else { return("<span style='color:black'>关闭</span>"); } }; result.FieldFormator.Register("status", proc); return(result); }
//提供数据的方法 public dotNetFlexGrid.DataHandlerResult DotNetFlexGrid3DataHandler(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); string packnum = "0"; if (p.extParam.ContainsKey("packnum")) { packnum = p.extParam["packnum"]; } if (packnum == "") { packnum = "0"; } string StartTime = "0"; if (p.extParam.ContainsKey("StartTime")) { StartTime = p.extParam["StartTime"]; } if (StartTime == "") { StartTime = "0"; } string EndTime = "0"; if (p.extParam.ContainsKey("EndTime")) { EndTime = p.extParam["EndTime"]; } if (EndTime == "") { EndTime = "0"; } TeModel tm = new TeModel(); // result.table = tm.findtisanemachineInfo(Convert.ToInt32(tisanenum), StartTime, EndTime); result.table = tm.findpackmachineInfo(Convert.ToInt32(packnum), StartTime, EndTime); return(result); }
public dotNetFlexGrid.DataHandlerResult FlexGridDrugDataHandler(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);//调用演示的数据生成函数产生模拟数据 TeModel tm = new TeModel(); string PackMachine = "0"; if (p.extParam.ContainsKey("PackMachine")) { PackMachine = p.extParam["PackMachine"]; } result.table = tm.getPackingMachineInfobyid(Convert.ToInt32(PackMachine)); //如果传递的参数包含排序设置的话,通过DataView.Sort功能模拟进行当页排序 //if (p.sortname.Length > 0 && p.sortorder.Length > 0) //{ // System.Data.DataView dv = result.table.DefaultView; // dv.Sort = (p.sortname + " " + p.sortorder); // result.table = dv.ToTable(); //} ////处理默认查询,即Button1_Click中指定的DefaultSearch查询参数 //if (p.defaultSearch.ContainsKey("String1")) //{ // System.Data.DataView dv = result.table.DefaultView; // dv.RowFilter = "String1 Like '%" + p.defaultSearch["String1"] + "%'"; // result.table = dv.ToTable(); //} ////如果传递的参数包含附加参数的话,再来模拟查询,原谅我真的很懒。 //if (p.extParam.ContainsKey("String1")) //{ // System.Data.DataView dv = result.table.DefaultView; // dv.RowFilter = "String1 Like '%" + p.extParam["String1"] + "%'"; // result.table = dv.ToTable(); //} ////如果传递的参数包含快速查询参数,则进行快速查询 //if (p.qop != dotNetFlexGrid.SerchParamConfigOperater.None && p.qtype.Length > 0 && p.query.Length > 0) //{ // System.Data.DataView dv = result.table.DefaultView; // if (p.qop == dotNetFlexGrid.SerchParamConfigOperater.Like) // dv.RowFilter = p.qtype + " Like '%" + p.query + "%'"; // else // dv.RowFilter = p.qtype + " = '" + p.query + "'"; // result.table = dv.ToTable(); //} return(result); }
public dotNetFlexGrid.DataHandlerResult FlexGridClearingpartyDataHandler(dotNetFlexGrid.DataHandlerParams p) { dotNetFlexGrid.DataHandlerResult result = new dotNetFlexGrid.DataHandlerResult(); result.page = p.page; //设定当前返回的页号 result.total = 100; //总计的数据条数,此处用100进行模拟,查询和筛选时需要根据实际 meRoomModel rm = new meRoomModel(); result.table = rm.findmeRoomInfo(); return(result); }
} //提供数据的方法 public dotNetFlexGrid.DataHandlerResult DotNetFlexGrid1DataHandler(dotNetFlexGrid.DataHandlerParams p) { dotNetFlexGrid.DataHandlerResult result = new dotNetFlexGrid.DataHandlerResult(); result.page = p.page; //设定当前返回的页号 result.total = 100; //总计的数据条数,此处用100进行模拟,查询和筛选时需要根据实际 RecipeModel rm = new RecipeModel(); string Clearing = ""; if (p.extParam.ContainsKey("Clearing")) { Clearing = p.extParam["Clearing"]; } string STime = ""; if (p.extParam.ContainsKey("STime")) { STime = p.extParam["STime"]; } string ETime = ""; if (p.extParam.ContainsKey("ETime")) { ETime = p.extParam["ETime"]; } string ClearingS = ""; if (p.extParam.ContainsKey("ClearingS")) { ClearingS = p.extParam["ClearingS"]; } result.table = rm.CheckListInfo(Clearing, ClearingS, STime, ETime); dotNetFlexGrid.FieldFormatorHandle proc61 = delegate(DataRow dr) { int a = Convert.ToInt32(dr["State"].ToString()); if (a == 1) { return("已结算"); } else { return("未结算"); } }; result.FieldFormator.Register("State", proc61); return(result); }
public dotNetFlexGrid.DataHandlerResult DotNetFlexGrid1DataHandler(dotNetFlexGrid.DataHandlerParams p) { dotNetFlexGrid.DataHandlerResult result = new dotNetFlexGrid.DataHandlerResult(); result.page = p.page; //设定当前返回的页号 result.total = 100; //总计的数据条数,此处用100进行模拟,查询和筛选时需要根据实际 StorageManageModel rm = new StorageManageModel(); result.table = rm.searchStorageInfochange(); return(result); }
/// <summary> /// 大屏显示 /// </summary> /// <param name="p"></param> /// <returns></returns> public dotNetFlexGrid.DataHandlerResult FlexGrid2DataHandler(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); HospitalModel hm = new HospitalModel(); result.table = hm.findInfo(); dotNetFlexGrid.FieldFormatorHandle proc = delegate(DataRow dr) { if (dr["DrugDisplayState"].ToString() == "0") { return("<span style='color:red'>开启</span>"); } else { return("关闭"); } }; result.FieldFormator.Register("DrugDisplayState", proc); dotNetFlexGrid.FieldFormatorHandle proc1 = delegate(DataRow dr) { if (dr["ChineseDisplayState"].ToString() == "0") { return("<span style='color:red'>开启</span>"); } else { return("关闭"); } }; result.FieldFormator.Register("ChineseDisplayState", proc1); dotNetFlexGrid.FieldFormatorHandle proc2 = delegate(DataRow dr) { if (dr["DrugSendDisplayState"].ToString() == "0") { return("<span style='color:red'>开启</span>"); } else { return("关闭"); } }; result.FieldFormator.Register("DrugSendDisplayState", proc2); return(result); }
public dotNetFlexGrid.DataHandlerResult FlexGridClearingpartyDataHandler(dotNetFlexGrid.DataHandlerParams p) { dotNetFlexGrid.DataHandlerResult result = new dotNetFlexGrid.DataHandlerResult(); result.page = p.page; //设定当前返回的页号 result.total = 100; //总计的数据条数,此处用100进行模拟,查询和筛选时需要根据实际 RecipientModel rm = new RecipientModel(); string ClearPName = "0"; if (p.extParam.ContainsKey("ClearPName")) { ClearPName = p.extParam["ClearPName"]; } result.table = rm.finRecipientInfo(ClearPName); return(result); }
public dotNetFlexGrid.DataHandlerResult DotNetFlexGrid1DataHandler(dotNetFlexGrid.DataHandlerParams p) { dotNetFlexGrid.DataHandlerResult result = new dotNetFlexGrid.DataHandlerResult(); result.page = p.page; //设定当前返回的页号 result.total = 100; //总计的数据条数,此处用100进行模拟,查询和筛选时需要根据实际 string pspnum = ""; if (p.extParam.ContainsKey("PspNum")) { pspnum = p.extParam["PspNum"]; } TeModel tm = new TeModel(); result.table = tm.searchTisaneClass(pspnum);//调用演示的数据生成函数产生模拟数据 dotNetFlexGrid.FieldFormatorHandle proca = delegate(DataRow dr) { string z = ""; if (dr["bs"].ToString() == "") { String az = dr["bs"].ToString(); az = "3"; if (az == "3") { z = "无"; } } else { int az = Convert.ToInt32(dr["bs"].ToString()); if (az == 1) { z = "泡药完成"; } } return(z); }; result.FieldFormator.Register("bs", proca); return(result); }
public dotNetFlexGrid.DataHandlerResult FlexGridFlexGridDrugDataHandler(dotNetFlexGrid.DataHandlerParams p) { dotNetFlexGrid.DataHandlerResult result = new dotNetFlexGrid.DataHandlerResult(); result.page = p.page; //设定当前返回的页号 result.total = 100; //总计的数据条数,此处用100进行模拟,查询和筛选时需要根据实际 DrugModel dm = new DrugModel(); string pid = ""; if (p.extParam.ContainsKey("pid")) { pid = p.extParam["pid"]; } result.table = dm.findDrugByPspnum(pid); return(result); }
public dotNetFlexGrid.DataHandlerResult DotNetFlexGrid1DataHandler(dotNetFlexGrid.DataHandlerParams p) { dotNetFlexGrid.DataHandlerResult result = new dotNetFlexGrid.DataHandlerResult(); result.page = p.page; //设定当前返回的页号 result.total = 100; //总计的数据条数,此处用100进行模拟,查询和筛选时需要根据实际 WarehousepharmacyModel rm = new WarehousepharmacyModel(); string Type = "0"; if (p.extParam.ContainsKey("Type")) { Type = p.extParam["Type"]; } result.table = rm.findWarehousepharmacyModelInfo(Type); return(result); }
} //提供数据的方法 public dotNetFlexGrid.DataHandlerResult DotNetFlexGrid1DataHandler(dotNetFlexGrid.DataHandlerParams p) { dotNetFlexGrid.DataHandlerResult result = new dotNetFlexGrid.DataHandlerResult(); result.page = p.page; //设定当前返回的页号 result.total = 100; //总计的数据条数,此处用100进行模拟,查询和筛选时需要根据实际 LossiModel hm1 = new LossiModel(); var Type = ""; if (p.extParam.ContainsKey("Type")) { Type = p.extParam["Type"]; } int pageSize = p.rp; result.table = hm1.finMedicineLossiInfor(Type); return(result); }
} //提供数据的方法 public dotNetFlexGrid.DataHandlerResult DotNetFlexGrid1DataHandler(dotNetFlexGrid.DataHandlerParams p) { dotNetFlexGrid.DataHandlerResult result = new dotNetFlexGrid.DataHandlerResult(); result.page = p.page; //设定当前返回的页号 result.total = 100; //总计的数据条数,此处用100进行模拟,查询和筛选时需要根据实际 RecipeModel rm = new RecipeModel(); string Salesman = ""; if (p.extParam.ContainsKey("Salesman")) { Salesman = p.extParam["Salesman"]; } string STime = ""; if (p.extParam.ContainsKey("STime")) { STime = p.extParam["STime"]; } string ETime = ""; if (p.extParam.ContainsKey("ETime")) { ETime = p.extParam["ETime"]; } string StaffId = ""; if (p.extParam.ContainsKey("StaffId")) { StaffId = p.extParam["StaffId"]; } int pageSize = p.rp; result.table = rm.finBusiPerinfo(Salesman, STime, ETime, StaffId); return(result); }
/// <summary> /// 反射调用映射的方法 /// </summary> /// <param name="cName"></param> /// <param name="fName"></param> /// <returns></returns> private dotNetFlexGrid.DataHandlerResult InvokeTargetMothod(string cName, string fName, dotNetFlexGrid.DataHandlerParams parm) { dotNetFlexGrid.DataHandlerResult dt = null; System.Type type = System.Type.GetType(cName, true); object obj = Activator.CreateInstance(type); MethodInfo func = type.GetMethod(fName, BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance); if (func != null) { object result = null; try { result = func.Invoke(obj, new object[] { parm }); } catch (TargetInvocationException ee) { throw ee.InnerException; } if (result != null) { dt = (dotNetFlexGrid.DataHandlerResult)result; } } else { throw new ApplicationException("dotNetFlexiGridAsyn.InvokeTargetMothod()调用失败,调用'" + cName + "." + fName + "'时未能找到方法!"); } //添加字段列表 if (_LocalDataColumnsDic == null) { _LocalDataColumnsDic = new Dictionary <string, DataColumn>(dt.table.Columns.Count); } _LocalDataColumnsDic.Clear(); foreach (DataColumn dc in dt.table.Columns) { _LocalDataColumnsDic.Add(dc.ColumnName, dc); } return(dt); }
public dotNetFlexGrid.DataHandlerResult DotNetFlexGrid3DataHandler(dotNetFlexGrid.DataHandlerParams p) { dotNetFlexGrid.DataHandlerResult result = new dotNetFlexGrid.DataHandlerResult(); result.page = p.page; //设定当前返回的页号 result.total = 100; //总计的数据条数,此处用100进行模拟,查询和筛选时需要根据实际 StorageManageModel rm = new StorageManageModel(); string operatenum = ""; if (p.extParam.ContainsKey("operatenum")) { operatenum = p.extParam["operatenum"]; } result.table = rm.findstoragefromdruginfobyopertatenum(operatenum); return(result); }
public dotNetFlexGrid.DataHandlerResult DotNetFlexGrid2DataHandler(dotNetFlexGrid.DataHandlerParams p) { dotNetFlexGrid.DataHandlerResult result = new dotNetFlexGrid.DataHandlerResult(); result.page = p.page; //设定当前返回的页号 result.total = 100; //总计的数据条数,此处用100进行模拟,查询和筛选时需要根据实际 StorageManageModel rm = new StorageManageModel(); string LSTime = ""; if (p.extParam.ContainsKey("LSTime")) { LSTime = p.extParam["LSTime"]; } string LETime = ""; if (p.extParam.ContainsKey("LETime")) { LETime = p.extParam["LETime"]; } string Warehousing = ""; if (p.extParam.ContainsKey("Warehousing")) { Warehousing = p.extParam["Warehousing"]; } string DrugName = ""; if (p.extParam.ContainsKey("DrugName")) { DrugName = p.extParam["DrugName"]; } result.table = rm.findStorageListInfo1(LSTime, LETime, Warehousing, DrugName); return(result); }
public dotNetFlexGrid.DataHandlerResult FlexGridClearingpartyDataHandler(dotNetFlexGrid.DataHandlerParams p) { dotNetFlexGrid.DataHandlerResult result = new dotNetFlexGrid.DataHandlerResult(); result.page = p.page; //设定当前返回的页号 result.total = 100; //总计的数据条数,此处用100进行模拟,查询和筛选时需要根据实际 ClearingpartyModel rm = new ClearingpartyModel(); string ClearPName = "0"; if (p.extParam.ContainsKey("ClearPName")) { ClearPName = p.extParam["ClearPName"]; } //result.table = rm.findRecipeInfo(11, "111"); // result.table = rm.findPackingInfo(Fpactate, Pacpersonnel, PacTime); result.table = rm.findClearingpartyInfo(Convert.ToInt32(ClearPName)); /* ClearingpartyHandler chandler = new ClearingpartyHandler(); * result.table = chandler.SearchClearingparty();*/ return(result); }
public dotNetFlexGrid.DataHandlerResult FlexGridRecipeDataHandler(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);//调用演示的数据生成函数产生模拟数据 string tisaneid = "0"; if (p.extParam.ContainsKey("tisaneid")) { tisaneid = p.extParam["tisaneid"]; } if (tisaneid == "") { tisaneid = "0"; } TeModel tm = new TeModel(); result.table = tm.getPreBytisaneid(Convert.ToInt32(tisaneid)); dotNetFlexGrid.FieldFormatorHandle proc = delegate(DataRow dr) { string a = ""; int tstatus = Convert.ToInt32(dr["tisanestatus"].ToString()); if (tstatus == 0) { a = "开始煎药"; } else if (tstatus == 1) { a = "煎药完成"; } /* else * { * a = "煎药"; * }*/ return(a); }; result.FieldFormator.Register("tisanestatus", proc); //如果传递的参数包含排序设置的话,通过DataView.Sort功能模拟进行当页排序 //if (p.sortname.Length > 0 && p.sortorder.Length > 0) //{ // System.Data.DataView dv = result.table.DefaultView; // dv.Sort = (p.sortname + " " + p.sortorder); // result.table = dv.ToTable(); //} ////处理默认查询,即Button1_Click中指定的DefaultSearch查询参数 //if (p.defaultSearch.ContainsKey("String1")) //{ // System.Data.DataView dv = result.table.DefaultView; // dv.RowFilter = "String1 Like '%" + p.defaultSearch["String1"] + "%'"; // result.table = dv.ToTable(); //} ////如果传递的参数包含附加参数的话,再来模拟查询,原谅我真的很懒。 //if (p.extParam.ContainsKey("String1")) //{ // System.Data.DataView dv = result.table.DefaultView; // dv.RowFilter = "String1 Like '%" + p.extParam["String1"] + "%'"; // result.table = dv.ToTable(); //} ////如果传递的参数包含快速查询参数,则进行快速查询 //if (p.qop != dotNetFlexGrid.SerchParamConfigOperater.None && p.qtype.Length > 0 && p.query.Length > 0) //{ // System.Data.DataView dv = result.table.DefaultView; // if (p.qop == dotNetFlexGrid.SerchParamConfigOperater.Like) // dv.RowFilter = p.qtype + " Like '%" + p.query + "%'"; // else // dv.RowFilter = p.qtype + " = '" + p.query + "'"; // result.table = dv.ToTable(); //} 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); }
public dotNetFlexGrid.DataHandlerResult FlexGridRecipeDataHandler(dotNetFlexGrid.DataHandlerParams p) { dotNetFlexGrid.DataHandlerResult result = new dotNetFlexGrid.DataHandlerResult(); result.page = p.page; //设定当前返回的页号 result.total = 100; //总计的数据条数,此处用100进行模拟,查询和筛选时需要根据实际 RecipeModel rm = new RecipeModel(); string hospitalId = "0"; if (p.extParam.ContainsKey("hospitalId")) { hospitalId = p.extParam["hospitalId"]; } string pspnum = ""; if (p.extParam.ContainsKey("pspnum")) { pspnum = p.extParam["pspnum"]; } string Status = "0"; if (p.extParam.ContainsKey("printStatus")) { Status = p.extParam["printStatus"]; } result.table = rm.findRecipeInfo(Convert.ToInt32(hospitalId), pspnum, Convert.ToInt32(Status)); 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); }
public dotNetFlexGrid.DataHandlerResult FlexGridFlexGridDrugDataHandler(dotNetFlexGrid.DataHandlerParams p) { dotNetFlexGrid.DataHandlerResult result = new dotNetFlexGrid.DataHandlerResult(); result.page = p.page; //设定当前返回的页号 result.total = 100; //总计的数据条数,此处用100进行模拟,查询和筛选时需要根据实际 DrugModel dm = new DrugModel(); string pspnum = "0"; string hospitalId = ""; // if (p.extParam.ContainsKey("drugpspnum")) // { // pspnum = p.extParam["drugpspnum"]; // } // if (p.extParam.ContainsKey("hospitalId")) // { // hospitalId = p.extParam["hospitalId"]; // } string pid = ""; if (p.extParam.ContainsKey("pid")) { pid = p.extParam["pid"]; } // result.table = dm.findDrugByPspnum(pspnum, hospitalId); result.table = dm.findDrugByPspnum(pid); dotNetFlexGrid.FieldFormatorHandle proc1 = delegate(DataRow dr) { string drugname1 = ""; string drugname2 = ""; RecipeModel rm = new RecipeModel(); DataTable dt = rm.findspecialdrug2(); string z = "<span style='color:black'>" + dr["Drugname"].ToString() + "</span>"; for (int i = 0; i < dt.Rows.Count; i++) { drugname1 = dt.Rows[i][2].ToString(); drugname2 = dt.Rows[i][3].ToString(); SqlDataReader sdr = rm.finddrugnamebypid(pid, drugname1); SqlDataReader sdr2 = rm.finddrugnamebypid(pid, drugname2); if (sdr.Read() && sdr2.Read()) { // z = "<span style='color:red'>"+dr["Drugname"].ToString()+"</span>"; if (dr["Drugname"].ToString() == drugname1 || dr["Drugname"].ToString() == drugname2) { z = "<span style='color:red'>" + dr["Drugname"].ToString() + "</span>"; } break; } else { z = "<span style='color:black'>" + dr["Drugname"].ToString() + "</span>"; } } return(z); }; result.FieldFormator.Register("Drugname", proc1); dotNetFlexGrid.FieldFormatorHandle proc5 = delegate(DataRow dr) { string z = ""; string drugname = dr["Drugname"].ToString(); RecipeModel rm = new RecipeModel(); SqlDataReader sdr = rm.findspecialdrug(drugname); if (sdr.Read()) { if (sdr["type"].ToString() == "先煎药") { z = "<span style='color:red'>先煎</span>"; } if (sdr["type"].ToString() == "后下") { z = "<span style='color:red'>后下</span>"; } if (sdr["type"].ToString() == "另煎药") { z = "<span style='color:red'>另煎药</span>"; } if (sdr["type"].ToString() == "冲服") { z = "<span style='color:red'>冲服</span>"; } if (sdr["type"].ToString() == "烊化药") { z = "<span style='color:red'>烊化药</span>"; } if (sdr["type"].ToString() == "禁用药") { z = "<span style='color:red'>(妊娠禁忌)禁用药</span>"; } if (sdr["type"].ToString() == "慎用药") { z = "<span style='color:red'>(妊娠禁忌)慎用药</span>"; } } else { z = "<span style='color:black'>" + dr["DrugDescription"].ToString() + "</span>"; } //dt.Rows[0]["hospitalid"].ToString(); // string z = ""; // for (int i = 0; i < dt.Rows.Count; i++) // { // string specialdrugname = dt.Rows[i][2].ToString(); // string specialtype = dt.Rows[i][1].ToString(); // if (drugname == specialdrugname) // { // if (specialtype == "十八反" || specialtype == "十九畏" || specialtype == "禁用药" || specialtype == "慎用药") // { // z = "<span style='color:red'>" + drugname + "</span>"; // break; // } // if (specialtype == "先煎药" || specialtype == "后下" || specialtype == "另煎药" || specialtype == "冲服" || specialtype == "烊化药") // { // z = "<span style='color:red'>" + drugname + "</span>"; // break; // } // } // else // { // } // } // z = "<span style='color:black'>" + drugname + "</span>"; return(z); }; result.FieldFormator.Register("DrugDescription", proc5); // result.table = dotNetFlexGrid.DemoMemoryTable(p.page * 100, p.rp);//调用演示的数据生成函数产生模拟数据 //如果传递的参数包含排序设置的话 ,通过DataView.Sort功能模拟进行当页排序 //if (p.sortname.Length > 0 && p.sortorder.Length > 0) //{ // System.Data.DataView dv = result.table.DefaultView; // dv.Sort = (p.sortname + " " + p.sortorder); // result.table = dv.ToTable(); //} ////处理默认查询,即Button1_Click中指定的DefaultSearch查询参数 //if (p.defaultSearch.ContainsKey("String1")) //{ // System.Data.DataView dv = result.table.DefaultView; // dv.RowFilter = "String1 Like '%" + p.defaultSearch["String1"] + "%'"; // result.table = dv.ToTable(); //} ////如果传递的参数包含附加参数的话,再来模拟查询,原谅我真的很懒。 //if (p.extParam.ContainsKey("String1")) //{ // System.Data.DataView dv = result.table.DefaultView; // dv.RowFilter = "String1 Like '%" + p.extParam["String1"] + "%'"; // result.table = dv.ToTable(); //} ////如果传递的参数包含快速查询参数,则进行快速查询 //if (p.qop != dotNetFlexGrid.SerchParamConfigOperater.None && p.qtype.Length > 0 && p.query.Length > 0) //{ // System.Data.DataView dv = result.table.DefaultView; // if (p.qop == dotNetFlexGrid.SerchParamConfigOperater.Like) // dv.RowFilter = p.qtype + " Like '%" + p.query + "%'"; // else // dv.RowFilter = p.qtype + " = '" + p.query + "'"; // result.table = dv.ToTable(); //} return(result); }