コード例 #1
0
        public ActionResult Create(DaysOFF model, string NumberOfMahdar, string Cat, int PublisherID, string Number, TimeSpan DateFrom, TimeSpan DateTo, DateTime reportDate, DateTime DayofDate)
        {
            model.Number       = NumberOfMahdar;
            model.CategoryName = Cat;
            model.empID        = PublisherID;
            model.Number       = Number;
            model.DateFrom     = DateFrom;
            model.DateTo       = DateTo;
            model.reportDate   = reportDate;
            model.DayofDate    = DayofDate;

            _db.DaysOFF.Add(model);
            _db.SaveChanges();

            var             models = new DaysOffWithEX();
            List <Category> res    = filldrop();

            models.CategoryX = res;
            return(View(models));
        }
コード例 #2
0
        public JsonResult DeleteDayOff(int ID)
        {
            bool result = false;

            try
            {
                DaysOFF model = _db.DaysOFF.Find(ID);
                _db.DaysOFF.Remove(model);
                _db.SaveChanges();
                result = true;
            }

            catch (Exception ex)
            {
                throw ex;
            }


            return(Json(result, JsonRequestBehavior.AllowGet));
        }