Exemplo n.º 1
0
        public string AutoCompleteGetAllOrderSet(string docName)
        {
            Service.WS_TrakcareCls ws = new Service.WS_TrakcareCls();
            var result = (from dn in ws.GetAllOrderSet(docName).AsEnumerable()
                          where dn.Field <string>("ARCOS_Desc").ToLower().Contains(docName.ToLower()) ||
                          dn.Field <string>("ARCOS_Code").ToLower().Contains(docName.ToLower())
                          select new { desc = dn.Field <string>("ARCOS_Code") + "|,|" + dn.Field <string>("ARCOS_Desc") + "|,|" + dn.Field <string>("ARCIC_Desc") }

                          ).ToList();
            string tmpStr  = string.Empty;
            string tmpConj = "<,>";
            var    result2 = (from t1 in result
                              select t1.desc).ToList();

            foreach (object st in result2)
            {
                tmpStr = tmpStr + HttpContext.Current.Server.HtmlEncode(st.ToString()) + tmpConj;
                //tmpStr = tmpStr + HttpContext.Current.Server.HtmlDecode(st.ToString()) + tmpConj;
            }
            if (!string.IsNullOrEmpty(tmpStr))
            {
                tmpStr.Substring(1, tmpStr.Length - tmpConj.Length);
            }
            return(tmpStr);
        }
Exemplo n.º 2
0
 public ActionResult Main(MasterPackageModel model)
 {
     try
     {
         using (Service.WS_TrakcareCls ws = new Service.WS_TrakcareCls())
         {
             PackageInformationModel pi = new PackageInformationModel();
             pi.string_search          = model.string_search;
             pi.listPackageInformation = ws.GetAllOrderSet(pi.string_search).AsEnumerable()
                                         .Where(x => x.Field <string>("ARCOS_Code") != null && x.Field <string>("ARCOS_Code").Trim() != "" &&
                                                x.Field <string>("ARCOS_Desc") != null && x.Field <string>("ARCOS_Desc").Trim() != "")
                                         .Select(x => new PackageInformation
             {
                 package_code = x.Field <string>("ARCOS_Code"),
                 package_name = x.Field <string>("ARCOS_Desc")
             }).Distinct()
                                         .ToList();
             if (pi.listPackageInformation.Count == 0)
             {
                 return(View(model));
             }
             else
             {
                 return(View("PackageList", pi));
             }
         }
         //using (InhCheckupDataContext cdc = new InhCheckupDataContext())
         //{
         //    PackageInformationModel pi = new PackageInformationModel();
         //    pi.string_search = model.string_search;
         //    pi.listPackageInformation = cdc.trn_patient_order_sets
         //                                   .Where(x => x.tos_od_set_code.ToUpper().StartsWith(model.string_search.ToUpper()))
         //                                   .Select(x => new PackageInformation
         //                                   {
         //                                       package_code = x.tos_od_set_code,
         //                                       package_name = x.tos_od_set_name
         //                                   }).Distinct()
         //                                   .ToList();
         //    if (pi.listPackageInformation.Count == 0)
         //    {
         //        return View(model);
         //    }
         //    else
         //    {
         //        return View("PackageList", pi);
         //    }
         //}
     }
     catch
     {
         return(View(model));
     }
 }
Exemplo n.º 3
0
 private string getPackageName(string package_code)
 {
     try
     {
         using (Service.WS_TrakcareCls ws = new Service.WS_TrakcareCls())
         {
             return(ws.GetAllOrderSet(package_code).AsEnumerable()
                    .Where(x => x.Field <string>("ARCOS_Code") != null && x.Field <string>("ARCOS_Code").Trim() != "" &&
                           x.Field <string>("ARCOS_Desc") != null && x.Field <string>("ARCOS_Desc").Trim() != "")
                    .Select(x => x.Field <string>("ARCOS_Desc")).FirstOrDefault());
             //return cdc.trn_patient_order_sets
             //          .Where(x => x.tos_od_set_code == package_code)
             //          .Select(x => x.tos_od_set_name)
             //          .FirstOrDefault();
         }
     }
     catch
     {
         return("");
     }
 }