public ActionResult AddProcessor(ProcessorModel model)
 {
     if (ModelState.IsValid)
     {
         processorSessionRepository.Add(model);
         return RedirectToAction("AddProcessor");
     }
     model.ProcessorTypes = GetProcessors();
     return PartialView("_AddProcessor", model);
 }
        public void Add(ProcessorModel processor)
        {
            var data = GetAll();

            var processors = CommonFunctions.GetProcessors();

            var p = processors.FirstOrDefault(a => a.KeyId == processor.ProcessorTypeId);
            if (p != null)
                processor.processorName = p.Description;

            if (processor.ID == 0)
            {
                if (data.Count > 0)
                    processor.ID = data.Max(a => a.ID) + 1;
                else
                    processor.ID = 100000;
            }

            data.Add(processor);
            HttpContext.Current.Session[SessionProcessList] = data;
        }
 public void Update(ProcessorModel processor)
 {
     Delete(processor.ID);
     Add(processor);
 }