public ActionResult DDFrequencyGridViewPartialUpdate(HovisMillingPortal.Models.t_Milling_Bacs_DDFrequency item)
        {
            //ViewBag.Company = new SelectList(db.t_SOP_Company, "CompRecid", "Compcode");
            var model = db.t_Milling_Bacs_DDFrequency;

            if (ModelState.IsValid)
            {
                try
                {
                    var modelItem = model.FirstOrDefault(it => it.DDFreqRecid == item.DDFreqRecid);
                    if (modelItem != null)
                    {
                        this.UpdateModel(modelItem);
                        db.SaveChanges();
                    }
                }
                catch (Exception e)
                {
                    ViewData["EditError"] = e.Message;
                }
            }
            else
            {
                ViewData["EditError"] = "Please, correct all errors.";
            }
            return(PartialView("_DDFrequencyGridViewPartial", model.ToList()));
        }
        public ActionResult DDFrequencyGridViewPartialAddNew(HovisMillingPortal.Models.t_Milling_Bacs_DDFrequency item)
        {
            //ViewBag.Company = new SelectList(db.t_SOP_Company, "CompRecid", "Compcode");
            var model = db.t_Milling_Bacs_DDFrequency;

            if (ModelState.IsValid)
            {
                try
                {
                    model.Add(item);
                    db.SaveChanges();
                }
                catch (Exception e)
                {
                    ViewData["EditError"] = e.Message;
                }
            }
            else
            {
                ViewData["EditError"] = "Please, correct all errors.";
            }
            return(PartialView("_DDFrequencyGridViewPartial", model.ToList()));
        }