public JsonResult Add(MSI_MediaForm _mediaform)
        {
            MSIMediaFormRepository repository;
            try
            {
                repository = new MSIMediaFormRepository();
                if (_mediaform.ID > 0)
                {
                    repository.Update(_mediaform);
                }
                else
                {
                    repository.Add(_mediaform);
                }
            }
            catch (Exception ex)
            {

            }
            //return _dpsform;
            return Json(_mediaform, JsonRequestBehavior.AllowGet);
        }
        public JsonResult Add(MSI_MediaForm _mediaform)
        {
            MSIMediaFormRepository repository;
            try
            {
                repository = new MSIMediaFormRepository();
                if (_mediaform.ID > 0)
                {
                    repository.Update(_mediaform);
                }
                else
                {
                    repository.Add(_mediaform);
                }
            }
            catch (Exception ex)
            {

            }
            //Keep the Affected RecordID in session
            Session["RecordID"] = _mediaform.ID;
            //return _dpsform;
            return Json(_mediaform, JsonRequestBehavior.AllowGet);
        }
        public JsonResult Search(MSI_MediaForm _mediaform)
        {
            vwAccount mediaFormData = null;
            vwAccountRepository viewRepository = null;
            try
            {
                viewRepository = new vwAccountRepository();
                if (_mediaform.PIMSAcct != null)
                {
                    mediaFormData = viewRepository.Get(x => x.ACCOUNT == _mediaform.PIMSAcct);

                }
                else
                {
                    mediaFormData = viewRepository.Get(x => x.OriginalAccount == _mediaform.OrigAcct);
                }

                //Filled data obtained from the Database
                _mediaform.AcctName = mediaFormData.NAME;
                _mediaform.CompanyRequesting = mediaFormData.RESPONSIBILITY;
                _mediaform.Portfolio = mediaFormData.Portfolio;
                _mediaform.PIMSAcct = mediaFormData.ACCOUNT;
                _mediaform.OrigAcct = mediaFormData.OriginalAccount;
                _mediaform.Seller = mediaFormData.Seller;
                _mediaform.OriginalLender = mediaFormData.Originator;
                _mediaform.SSN = mediaFormData.SSN;
                _mediaform.OpenDate = mediaFormData.OpenDate;
                _mediaform.CODate = mediaFormData.ChargeOffDate;
                _mediaform.OrderNumber = RandomGen2.Next().ToString();
                _mediaform.GUID = System.Guid.NewGuid().ToString();

            }
            catch (Exception ex)
            {
            }
            //return the Json Object
            return Json(_mediaform, JsonRequestBehavior.AllowGet);
        }