Esempio n. 1
0
        public ActionResult Index(TimeSheetViewModel SearchModel)
        {
            if (Session["Username"] == null)
            {
                return(RedirectToAction("Login", "Login"));
            }
            else
            {
                TimeSheetViewModel model = new TimeSheetViewModel();
                model.Projectlist           = new SelectList(TimeSheetAPIHelperService.JMSProjects().Result, "ID", "Value");
                model.OpportunityNumberList = new SelectList(TimeSheetAPIHelperService.CostModelProject().Result, "ID", "OpportunityNumber");
                var listitem = TimeSheetAPIHelperService.CostModelProject().Result.Select(x => new ListItemViewModel()
                {
                    Id    = x.Id,
                    Value = x.Value
                });
                int opportunityId = listitem.FirstOrDefault().Id;
                model.ActivityList      = new SelectList(TimeSheetAPIHelperService.ProjectActivities(opportunityId).Result, "ID", "Value");
                model.WarehouseNameList = new SelectList(ListItemService.Warehouses().Result, "ID", "Value");
                model.CandidateNameList = new SelectList(ListItemService.Resources().Result, "ID", "Value");
                var Search = new SearchViewModel
                {
                    ProjectID           = SearchModel.ProjectID,
                    WarehouseNameId     = SearchModel.WarehouseID,
                    CandidateNameId     = SearchModel.ResourceID,
                    OpportunityNumberID = SearchModel.OpportunityID
                };

                model.CandidateTimeSheetList = SearchFilterService.SearchTimeSheetRecord(Search).Result;
                return(View(model));
            }
        }
Esempio n. 2
0
        public ActionResult TimeSheet()
        {
            TimeSheetViewModel model     = new TimeSheetViewModel();
            ListItemViewModel  listitems = new ListItemViewModel();

            model.Projectlist           = new SelectList(TimeSheetAPIHelperService.CostModelProject().Result, "ID", "Value");
            model.OpportunityNumberList = new SelectList(TimeSheetAPIHelperService.CostModelProject().Result, "ID", "OpportunityNumber");
            var listitem = TimeSheetAPIHelperService.CostModelProject().Result.Select(x => new ListItemViewModel()
            {
                Id = x.Id, Value = x.Value
            });
            int opportunityId = listitem.FirstOrDefault().Id;

            model.ActivityList = new SelectList(TimeSheetAPIHelperService.ProjectActivities(opportunityId).Result, "ID", "Value");
            return(View(model));
        }
Esempio n. 3
0
 public ActionResult Index()
 {
     if (Session["Username"] == null)
     {
         return(RedirectToAction("Login", "Login"));
     }
     else
     {
         TimeSheetViewModel model = new TimeSheetViewModel();
         model.Projectlist = new SelectList(TimeSheetAPIHelperService.CostModelProject().Result, "ID", "Value");
         //   model.OpportunityNumberList = new SelectList(TimeSheetAPIHelperService.CostModelProject().Result, "ID", "OpportunityNumber");
         model.WarehouseNameList      = new SelectList(ListItemService.Warehouses().Result, "ID", "Value");
         model.CandidateNameList      = new SelectList(ListItemService.Resources().Result, "ID", "Value");
         model.CandidateTimeSheetList = TimeSheetAPIHelperService.TimeSheetList().Result;
         return(View(model));
     }
 }
Esempio n. 4
0
        public ActionResult Register()
        {
            TimeSheetViewModel model = new TimeSheetViewModel();

            model.Projectlist           = new SelectList(TimeSheetAPIHelperService.CostModelProject().Result, "ID", "Value");
            model.OpportunityNumberList = new SelectList(TimeSheetAPIHelperService.CostModelProject().Result, "ID", "OpportunityNumber");
            var listitem = TimeSheetAPIHelperService.CostModelProject().Result.Select(x => new ListItemViewModel()
            {
                Id    = x.Id,
                Value = x.Value
            });
            int opportunityId = listitem.FirstOrDefault().Id;

            model.ActivityList           = new SelectList(TimeSheetAPIHelperService.ProjectActivities(opportunityId).Result, "ID", "Value");
            model.WarehouseNameList      = new SelectList(ListItemService.Warehouses().Result, "ID", "Value");
            model.CandidateNameList      = new SelectList(ListItemService.Resources().Result, "ID", "Value");
            model.CandidateTimeSheetList = TimeSheetAPIHelperService.TimeSheetList().Result;
            return(PartialView("Register", model));
        }