public List <ResourceNameOnlyModel> GetResourceNamesOnly(SingleIDModel single) { var result = (from res in dbcontext.Resources join resall in dbcontext.ResourceAllocations on res.ResourceID equals resall.ResourceID where resall.ProjectID == single.ID1 select new ResourceNameOnlyModel() { ResourceNames = res.Name }).ToList(); return(result); }
public List <ProjectNameOnlyModel> GetProjectNameForTheResource(SingleIDModel s) { var result = (from pro in dbcontext.Projects join resall in dbcontext.ResourceAllocations on pro.ProjectID equals resall.ProjectID where resall.ResourceID == s.ID1 select new ProjectNameOnlyModel() { ProjectName = pro.ProjectName }).ToList(); return(result); }
public List <ResourceNameModel> GetResourceNames(SingleIDModel s) { var result = (from r in dbcontext.Resources where !dbcontext.ResourceAllocations.Any(rs => (rs.ResourceID == r.ResourceID) && (rs.ProjectID == s.ID1)) select new ResourceNameModel() { ResourceID = r.ResourceID, Name = r.Name } ).ToList(); return(result); }
private async void ChooseResNameCmbBox_SelectedIndexChangedAsync(object sender, EventArgs e) { if (ChooseResNameCmbBox.SelectedValue != null) { bool success = Int32.TryParse(ChooseResNameCmbBox.SelectedValue.ToString(), out int id); if (success) { SingleIDModel s = new SingleIDModel() { ID1 = id }; var resourceNames2 = await RAB.GetProjectNameAllocatedToResource(s); ProjectAllocationDataGrid.DataSource = resourceNames2; } } }
private async void SelectProCmbBox_SelectedIndexChangedAsync(object sender, EventArgs e) { bool success = Int32.TryParse(SelectProCmbBox.SelectedValue.ToString(), out int final); if (success) { SingleIDModel s = new SingleIDModel() { ID1 = final }; var resourceNameOnly = await RAB.ShowResourcesNotAssignedToTheProjectAsync(s); SelectResCmbBox.DataSource = resourceNameOnly; SelectResCmbBox.DisplayMember = "Name"; SelectResCmbBox.ValueMember = "ResourceID"; SelectResCmbBox.SelectedIndex = -1; } }
public List <ProjectNameOnlyModel> GetProjectNameAllocatedToResource(SingleIDModel s) { return(_service.GetProjectNameForTheResource(s)); }
public List <ResourceNameModel> ShowResourceNames(SingleIDModel s) { return(_service.GetResourceNames(s)); }
public List <ResourceNameOnlyModel> GetResourceNameOnly(SingleIDModel single) { return(_service.GetResourceNamesOnly(single)); }
public async Task <List <ProjectNameOnlyModel> > GetProjectNameAllocatedToResource(SingleIDModel single) { return(await web.PostAsync <List <ProjectNameOnlyModel>, SingleIDModel>("resourceallocation//getprojectnamefortheresource", single)); }
public async Task <List <ResourceNameOnlyModel> > GetResourceNamesAsync(SingleIDModel single) { return(await web.PostAsync <List <ResourceNameOnlyModel>, SingleIDModel>("resourceallocation//getresourcenames", single)); }
public async Task <List <ResourceNameModel> > ShowResourcesNotAssignedToTheProjectAsync(SingleIDModel s) { return(await web.PostAsync <List <ResourceNameModel>, SingleIDModel>("resourceallocation//showresourcenames", s)); }