Click here to Skip to main content
15,912,837 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to assign multiple tasks to one employee at a time and one task to multiple employees at a time I am new in asp.net MVC I want some help some code example or whatever which can better explain the concept?

What I have tried:

What I have done is that the admin can create task and assign to one employee at a time and employee can see the tasks my code for create task is
public ActionResult Create()
      {
          var s = new SelectList(db.Accounts, "AccountId", "Name");
          ViewData["assitask.AccountId"] = s;
          ViewBag.TaskId = new SelectList(db.Tasks, "TaskId", "TaskName");
          return View();
      }

and the code for assign task to employee is
public ActionResult Create()
      {
          var s= new SelectList(db.Accounts, "AccountId", "Name");
          ViewBag.AccountId = s;
          ViewBag.TaskId = new SelectList(db.Tasks, "TaskId", "TaskName");
          return View();
      }

Hope for the better and positive response from experts.
Posted
Updated 10-May-16 8:13am

If you ask 1000 developers this question you'll get 1000 different answers. You are asking how to design your app. Well, one way is to have a list of checkboxes so that they can pick multiple. You could do it other ways too. It's up to you. But there is no automatic plugin code that you can copy and paste to make this work. You have to decide how you want it to work and then write the code to do it.
 
Share this answer
 
Comments
arslan afzal bhatti 10-May-16 12:52pm    
will you, please come up with small sample code that how can I implement it through checkboxes ? it would be very helpful for me to start the work
Quote:
I want to assign multiple tasks to one employee at a time and one task to multiple employees at a time
this is a vague description of your assignment which covers anything between the 2 extremes. You didn't even give details on the constraints. It is just a very bad description of your HomeWork.
Quote:
I am new in asp.net MVC
This is not the problem !
The problem is that you have to design how things must work in the project, design that you obviously haven't done.
Quote:
Hope for the better and positive response from experts.
Your question is just rude to everyone here.
Start working !
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900