Esempio n. 1
0
        public HttpResponseMessage UpdateTBAinformationInDB(ContractConsultant cc, IEnumerable <ContractConsultant> CslTBAassignment)
        {
            var currentTBA             = cc.LocationsAssigned.FirstOrDefault();
            HttpResponseMessage result = null;

            //  17/08/2017 : added the case to unassign a TBA : cc.INITIALS == null


            // new way: post then if failed put
            //      5 cases:
            //          new csl , new TBA
            //          new csl , exist TBA
            //          exist csl , new TBA
            //          exist csl , exist TBA
            //          csl null , exist TBA (unassignment)



            // create consultant if not in DB, ignore TBA creation or update or unassigned
            if (cc.INITIALS != null)
            {
                cc.LocationsAssigned = null;
                APIuse.PostToWebAPI(compDBapi, "ContractConsultants", cc);
            }

            // create or update TBA assignment
            result = APIuse.PostToWebAPI(compDBapi, "TBALocations", currentTBA);
            if (!result.IsSuccessStatusCode)
            {
                result = APIuse.PutToWebAPI(compDBapi, "TBALocations", currentTBA, currentTBA.CODE);
            }


            return(result);
        }
Esempio n. 2
0
        public virtual async Task ExtractAllBStagesAsync()
        {
            //      extract all the booking stages

            string API_Controller = "bstages";

            listBStage = await APIuse.GetFromWebAPIAsync <BStage>(compDBapi, API_Controller);
        }
Esempio n. 3
0
        public virtual void ExtractAllBStages()
        {
            //      extract all the booking stages

            string API_Controller = "bstages";

            listBStage = APIuse.GetFromWebAPI <BStage>(compDBapi, API_Controller);
        }
Esempio n. 4
0
        public ActionResult Index()
        {
            //      Display the Log_Update table on the index view
            //      this table should only be visible by myself and JM
            IEnumerable <Log_Update> listUpdates = APIuse.Extract_Log_Update(User.Identity.Name);

            if (listUpdates != null)
            {
                ViewData["listUpdates"] = listUpdates;
            }


            Dictionary <string, Dictionary <string, string> > CalendarLinksModel = ReturnCalendarLinksModel();

            return(View(CalendarLinksModel));
        }
Esempio n. 5
0
        public async Task <IEnumerable <ContractConsultant> > GetConsultantsTBAsLocationsAsync()
        {
            string API_Controller = "ContractConsultants";

            return(await APIuse.GetFromWebAPIAsync <ContractConsultant>(compDBapi, API_Controller));
        }
Esempio n. 6
0
        public IEnumerable <ContractConsultant> GetConsultantsTBAsLocations()
        {
            string API_Controller = "ContractConsultants";

            return(APIuse.GetFromWebAPI <ContractConsultant>(compDBapi, API_Controller));
        }