public List <user> getMyEmployees(int id) { ServiceUser serviceuser = new ServiceUser(); user user = serviceuser.GetById(id); buisness buisness = this.GetMany(ub => (ub.user.id == user.id) && (ub.role == "HR")).ToList().ElementAt(0).buisness; List <userbuisness> userbuisness = this.findBybuisness(buisness.id).ToList(); List <user> users = new List <user>(); foreach (var ub in userbuisness) { if (ub.role == "RM") { ub.user.role = "Recruiter Manager"; users.Add(ub.user); } if (ub.role == "EMP") { ub.user.role = "Employee"; users.Add(ub.user); } } return(users); }
public ActionResult Active(int id) { buisness buisness = bu.GetById(id); buisness.valid = true; bu.commit(); return(RedirectToAction("DesBusiness", "Business")); }
public ActionResult DeleteConfirmed(int id) { buisness buisness = bu.GetById(id); bu.Delete(buisness); bu.commit(); return(RedirectToAction("DesBusiness", "Business")); }
// GET: Business/Details/5 public ActionResult Details(int id) { buisness b = new buisness(); b = bu.GetById(id); ViewBag.business = b; ViewBag.nbUsers = b.Users.Count(); ViewBag.nbStages = b.Stages.Count(); ViewBag.nbJobs = b.Jobs.Count(); ViewBag.sommeSal = bu.getSumSalary(b.id); ViewBag.bestEmpl = bu.getBestEmpByBusiness(b.id); return(View()); }
static void Main(string[] args) { System.Console.WriteLine("here1"); //mysqlpiContext mc = new mysqlpiContext(); buisness b = new buisness(); b.name = "test final"; /*mc.buisnesses.Add(b); * mc.SaveChanges();*/ IServiceBusiness service = new ServiceBusiness(); service.Add(b); service.commit(); System.Console.WriteLine("here2"); System.Console.Read(); }
// GET: Business/Delete/5 public ActionResult Delete(int id) { buisness buisness = bu.GetById(id); return(View(buisness)); }