public IActionResult LoadModuleList(string listId)
        {
            string token = HttpContext.Session.GetString("access_token");
            List <ModulesModel> listModulesModel  = APIservice.GetList <ModulesModel>("synapsenamespace=meta&synapseentityname=module", token);
            List <Mappedmodule> listMappedmodules = APIservice.GetListById <Mappedmodule>(listId.Trim(), "synapsenamespace=meta&synapseentityname=applicationmodulemapping&synapseattributename=application_id&attributevalue=", token).OrderBy(o => o.displayorder).ToList();
            List <Mappedmodule> Mappedmodule      = listMappedmodules;
            List <ModulesModel> list = listModulesModel;
            List <ApplicationModuleMappingModel> mapping = new List <ApplicationModuleMappingModel>();

            mapping = (from customer in list
                       select customer)
                      .Select(x => new ApplicationModuleMappingModel()
            {
                module_id  = x.module_id,
                modulename = x.modulename
            }).ToList();
            var query = from x in mapping
                        join y in Mappedmodule
                        on x.module_id equals y.module_id
                        select new { x, y };

            foreach (var match in query)
            {
                match.x.isselected = true;
                match.x.applicationmodulemapping_id = match.y.applicationmodulemapping_id;
                match.x.modulename = match.y.displayname;
            }



            return(Json(JsonConvert.SerializeObject(mapping)));
        }
        public ActionResult saveNewModule(ModulesModel ModulesModel)
        {
            string token = HttpContext.Session.GetString("access_token");
            List <ModulesModel> result = APIservice.GetList <ModulesModel>("synapsenamespace=meta&synapseentityname=module", token);
            int count = result.Where(x => x.modulename == ModulesModel.modulename.Trim()).Count();

            if (count == 0)
            {
                ModulesModel Model = new ModulesModel();
                Guid         id    = Guid.NewGuid();
                Model.module_id         = id.ToString();
                Model.modulename        = ModulesModel.modulename.Trim();
                Model.jsurl             = ModulesModel.jsurl ?? "";
                Model.moduledescription = ModulesModel.moduledescription;
                Model.domselector       = ModulesModel.domselector ?? "";
                Model.displayorder      = result.Max(x => x.displayorder);
                Model.displayorder++;
                APIservice.PostObject <ModulesModel>(Model, "synapsenamespace=meta&synapseentityname=module", token);
                return(RedirectToAction(nameof(ApplicationManager)));
            }
            else
            {
                @ViewBag.errormessage = "(Module name already Exists ";
                return(View("AddNewModule"));
            }
        }
예제 #3
0
        public IActionResult LocationList()
        {
            string token = HttpContext.Session.GetString("access_token");
            List <LocationModel> locations = APIservice.GetList <LocationModel>("synapsenamespace=core&synapseentityname=location", token).OrderBy(l => l.locationcode).ToList();

            return(View(locations));
        }
        public EmptyResult MapModuletoApplication(string listId, string attributename, int ordinalposition)
        {
            string token = HttpContext.Session.GetString("access_token");
            List <ModulesModel> listModulesModel  = APIservice.GetList <ModulesModel>("synapsenamespace=meta&synapseentityname=module", token);
            List <Mappedmodule> listMappedmodules = APIservice.GetListById <Mappedmodule>(listId.Trim(), "synapsenamespace=meta&synapseentityname=applicationmodulemapping&synapseattributename=application_id&attributevalue=", token).OrderBy(o => o.displayorder).ToList();

            Mappedmodule Model     = new Mappedmodule();
            Guid         id        = Guid.NewGuid();
            ModulesModel moduleobj = listModulesModel.Single(s => s.module_id == attributename);

            Model.applicationmodulemapping_id = id.ToString();
            Model.application_id  = listId.Trim();
            Model.module_id       = attributename;
            Model.displayname     = moduleobj.modulename;
            Model.isdefaultmodule = false;
            if (listMappedmodules.Count == 0)
            {
                Model.displayorder = 1;
            }
            else
            {
                Model.displayorder = listMappedmodules.Max(x => x.displayorder.Value) + 1;
            }

            string results = APIservice.PostObject <Mappedmodule>(Model, "synapsenamespace=meta&synapseentityname=applicationmodulemapping", token);

            return(new EmptyResult());
        }
예제 #5
0
        public IActionResult SpecialtyList()
        {
            string token = HttpContext.Session.GetString("access_token");
            List <SpecialtyModel> specialties = APIservice.GetList <SpecialtyModel>("synapsenamespace=core&synapseentityname=specialty", token).OrderBy(s => s.specialtycode).ToList();

            return(View(specialties));
        }
예제 #6
0
        private List <WardBayBedModel> GetWardBayBeds(string wardCode, string bayCode)
        {
            string token = HttpContext.Session.GetString("access_token");

            List <WardBayBedModel> wardBayBeds = new List <WardBayBedModel>();

            if (wardCode is null)
            {
                wardBayBeds = APIservice.GetList <WardBayBedModel>("synapsenamespace=meta&synapseentityname=wardbaybed", token);
            }
            else
            {
                wardBayBeds = APIservice.GetListById <WardBayBedModel>(wardCode,
                                                                       "synapsenamespace=meta&synapseentityname=wardbaybed&synapseattributename=wardcode&attributevalue=", token);
            }

            if (bayCode is null)
            {
                return(wardBayBeds.OrderBy(w => w.wardcode).ThenBy(w => w.baycode).ThenBy(w => w.bedcode).ToList());
            }
            else
            {
                return(wardBayBeds.Where(w => w.baycode == bayCode).OrderBy(w => w.wardcode).ThenBy(w => w.baycode).ThenBy(w => w.bedcode).ToList());
            }
        }
        public IActionResult ProviderList()
        {
            string token = HttpContext.Session.GetString("access_token");
            List <ProviderModel> providers = APIservice.GetList <ProviderModel>("synapsenamespace=core&synapseentityname=provider", token).OrderBy(p => p.firstname).ToList();

            return(View(providers));
        }
        public IActionResult WardList()
        {
            string           token    = HttpContext.Session.GetString("access_token");
            List <WardModel> wardList = APIservice.GetList <WardModel>("synapsenamespace=meta&synapseentityname=ward", token).OrderBy(w => w.wardcode).ToList();

            return(View(wardList));
        }
        public IActionResult SaveDisplayName(string listId, string Modelid, string displayname, bool isdefaultmodule)
        {
            string token = HttpContext.Session.GetString("access_token");
            List <ModulesModel> listModulesModel  = APIservice.GetList <ModulesModel>("synapsenamespace=meta&synapseentityname=module", token);
            List <Mappedmodule> listMappedmodules = APIservice.GetListById <Mappedmodule>(listId.Trim(), "synapsenamespace=meta&synapseentityname=applicationmodulemapping&synapseattributename=application_id&attributevalue=", token).OrderBy(o => o.displayorder).ToList();

            if (isdefaultmodule)
            {
                Mappedmodule getselectedModel = listMappedmodules.FirstOrDefault(s => s.isdefaultmodule == true);
                if (getselectedModel != null)
                {
                    getselectedModel.isdefaultmodule = false;
                    string updatedresult = APIservice.PostObject <Mappedmodule>(getselectedModel, "synapsenamespace=meta&synapseentityname=applicationmodulemapping", token);
                }
            }

            List <Mappedmodule> Mappedmodule = listMappedmodules;
            Mappedmodule        Model        = Mappedmodule.Single(s => s.applicationmodulemapping_id == Modelid);

            Model.displayname     = displayname;
            Model.isdefaultmodule = isdefaultmodule;
            string results = APIservice.PostObject <Mappedmodule>(Model, "synapsenamespace=meta&synapseentityname=applicationmodulemapping", token);

            return(new EmptyResult());
        }
        private List <string> GetProviderRoles()
        {
            string token = HttpContext.Session.GetString("access_token");

            List <ProviderRole> providerRoles = APIservice.GetList <ProviderRole>("synapsenamespace=meta&synapseentityname=providerrole", token);

            return(providerRoles.Select(p => p.role).ToList());
        }
        public IActionResult ApplicationManager()
        {
            string token = HttpContext.Session.GetString("access_token");
            List <ApplicationModule> Applicationlist = APIservice.GetList <ApplicationModule>("synapsenamespace=meta&synapseentityname=application", token);
            List <ModulesModel>      modulelist      = APIservice.GetList <ModulesModel>("synapsenamespace=meta&synapseentityname=module", token);

            ViewBag.Applicationlist  = Applicationlist;
            ViewBag.modulelist       = modulelist;
            ViewBag.applicationcount = Applicationlist.Count();
            ViewBag.modulecount      = modulelist.Count();

            return(View());
        }
예제 #12
0
        public IActionResult ApplicationList()
        {
            string token = HttpContext.Session.GetString("access_token");
            List <ApplicationModule> Applicationlist = APIservice.GetList <ApplicationModule>("synapsenamespace=meta&synapseentityname=application", token);
            List <PatientListModel>  resultlist      = getListofListModel();

            ViewBag.Applicationlist  = Applicationlist;
            ViewBag.list             = resultlist;
            ViewBag.applicationcount = Applicationlist.Count();
            ViewBag.listcount        = resultlist.Count();

            return(View());
        }
예제 #13
0
        public IActionResult WardBayBedList()
        {
            string token = HttpContext.Session.GetString("access_token");

            WardBayBedIndexViewModel wardBayBedIndexViewModel = new WardBayBedIndexViewModel();

            wardBayBedIndexViewModel.Wards    = GetWards();
            wardBayBedIndexViewModel.WardBays = new List <WardBayModel>();

            wardBayBedIndexViewModel.WardBayBeds = APIservice.GetList <WardBayBedModel>("synapsenamespace=meta&synapseentityname=wardbaybed", token).OrderBy(w => w.wardcode).ThenBy(w => w.baycode).ThenBy(w => w.bedcode).ToList();

            return(View(wardBayBedIndexViewModel));
        }
        public IActionResult WardBayList()
        {
            string token = HttpContext.Session.GetString("access_token");

            List <WardModel>    wardList    = GetWards();
            List <WardBayModel> wardBayList = APIservice.GetList <WardBayModel>("synapsenamespace=meta&synapseentityname=wardbay", token);

            WardBayViewModel wardBayViewModel = new WardBayViewModel();

            wardBayViewModel.Wards    = wardList;
            wardBayViewModel.WardBays = wardBayList.OrderBy(w => w.wardcode).ThenBy(w => w.warddisplay).ThenBy(w => w.baycode).ToList();

            return(View(wardBayViewModel));
        }
예제 #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ApplicationId = Request.QueryString["id"].ToString();

            if (!IsPostBack)

            {
                List <ApplicationModule> listapplication = APIservice.GetList <ApplicationModule>("synapsenamespace=meta&synapseentityname=application");
                if (listapplication != null)
                {
                    string applicationname = listapplication.FirstOrDefault(s => s.application_id == ApplicationId).applicationname;
                    lblapplicationname.Text = applicationname;
                    listModulesModel        = APIservice.GetList <ModulesModel>("synapsenamespace=meta&synapseentityname=module");
                    listMappedmodules       = APIservice.GetListById <Mappedmodule>(ApplicationId, "synapsenamespace=meta&synapseentityname=applicationmodulemapping&synapseattributename=application_id&attributevalue=").OrderBy(o => o.displayorder).ToList();
                }
            }
        }
 private void GetModules()
 {
     using (var client = new HttpClient())
     {
         List <ModulesModel> resultj = APIservice.GetList <ModulesModel>("synapsenamespace=meta&synapseentityname=module");
         if (resultj == null)
         {
             lblModuleCount.Text = "0";
             maxmodule           = 1;
             dgModule.DataSource = resultj;
             dgModule.DataBind();
         }
         else
         {
             lblModuleCount.Text = resultj.Count.ToString();
             maxmodule           = resultj.Max(x => x.displayorder);
             dgModule.DataSource = resultj;
             dgModule.DataBind();
         }
     }
 }
 private void GetApplication()
 {
     using (var client = new HttpClient())
     {
         List <ApplicationModule> resultj = APIservice.GetList <ApplicationModule>("synapsenamespace=meta&synapseentityname=application");
         if (resultj == null)
         {
             lblApplicationCount.Text = "0";
             maxapporder = 1;
             dgApplication.DataSource = resultj;
             dgApplication.DataBind();
         }
         else
         {
             lblApplicationCount.Text = resultj.Count.ToString();
             maxapporder = resultj.Max(x => x.displayorder);
             dgApplication.DataSource = resultj;
             dgApplication.DataBind();
         }
     }
 }
        public IActionResult GetWardBaysForWard(WardBayViewModel wardBay)
        {
            string token = HttpContext.Session.GetString("access_token");

            List <WardModel>    wardList    = GetWards();
            List <WardBayModel> wardBayList = new List <WardBayModel>();

            if (wardBay.SelectedWardCode is null)
            {
                wardBayList = APIservice.GetList <WardBayModel>("synapsenamespace=meta&synapseentityname=wardbay", token);
            }
            else
            {
                wardBayList = APIservice.GetListById <WardBayModel>(wardBay.SelectedWardCode, "synapsenamespace=meta&synapseentityname=wardbay&synapseattributename=wardcode&attributevalue=", token);
            }

            WardBayViewModel wardBayViewModel = new WardBayViewModel();

            wardBayViewModel.Wards    = wardList;
            wardBayViewModel.WardBays = wardBayList.OrderBy(w => w.wardcode).ThenBy(w => w.warddisplay).ThenBy(w => w.baycode).ToList();

            return(View("WardBayList", wardBayViewModel));
        }
        public ActionResult saveNewApplication(ApplicationModule Actionmodel)
        {
            string token = HttpContext.Session.GetString("access_token");
            List <ApplicationModule> resultj = APIservice.GetList <ApplicationModule>("synapsenamespace=meta&synapseentityname=application", token);
            int count = resultj.Where(x => x.applicationname == Actionmodel.applicationname.Trim()).Count();

            if (count == 0)
            {
                ApplicationModule Model = new ApplicationModule();
                Guid id = Guid.NewGuid();
                Model.application_id  = id.ToString();
                Model.applicationname = Actionmodel.applicationname.Trim();
                Model.displayorder    = resultj.Max(x => x.displayorder);
                Model.displayorder++;
                string result = APIservice.PostObject <ApplicationModule>(Model, "synapsenamespace=meta&synapseentityname=application", token);
                return(RedirectToAction(nameof(ApplicationManager)));
            }
            else
            {
                @ViewBag.errormessage = "Application name already Exists ";
                return(View("AddNewApplication"));
            }
        }
        private List <WardModel> GetWards()
        {
            string token = HttpContext.Session.GetString("access_token");

            return(APIservice.GetList <WardModel>("synapsenamespace=meta&synapseentityname=ward", token).OrderBy(w => w.warddisplay).ToList());
        }
예제 #21
0
        /// <summary>
        /// Check Application Name
        /// </summary>
        /// <returns></returns>
        private int GetApplication()
        {
            List <ApplicationModule> resultj = APIservice.GetList <ApplicationModule>("synapsenamespace=meta&synapseentityname=application");

            return(resultj.Where(x => x.applicationname == txtApplication.Text.Trim()).Count());
        }
예제 #22
0
        private List <LocationType> GetLocationTypes()
        {
            string token = HttpContext.Session.GetString("access_token");

            return(APIservice.GetList <LocationType>("synapsenamespace=meta&synapseentityname=locationtype", token).OrderBy(l => l.locationtypetext).ToList());
        }
예제 #23
0
        private int GetModules()
        {
            List <ModulesModel> resultj = APIservice.GetList <ModulesModel>("synapsenamespace=meta&synapseentityname=module");

            return(resultj.Where(x => x.modulename == txtmodulename.Text.Trim()).Count());
        }