Exemplo n.º 1
0
        public ActionResult reject(int id)
        {
            leaves1 l = entities.leaves1.Find(id);
            Detail  d = entities.Details.Find(id);

            l.status = "Rejected";
            entities.SaveChanges();
            return(View());
        }
Exemplo n.º 2
0
        public ActionResult accept(int id)
        {
            leaves1 l = entities.leaves1.Find(id);
            Detail  d = entities.Details.Find(l.empId);

            l.status    = "Accepted";
            d.available = d.available - l.leaves;
            entities.SaveChanges();
            return(View());
        }
Exemplo n.º 3
0
        public ActionResult request(int empId, string empName, string empType, string dept, string reason, int leaves, DateTime from, DateTime to)
        {
            leaves1 d = new leaves1();

            ViewData["request"] = "true";
            d.empId             = empId;
            d.empName           = empName;
            d.empType           = empType;
            d.dept   = dept;
            d.reason = reason;
            d.leaves = leaves;
            d.from   = from;
            d.to     = to;
            d.status = "pending";
            entities.leaves1.Add(d);
            entities.SaveChanges();
            return(View());
        }