Esempio n. 1
0
        public ActionResult Save(Programm programm)
        {
            ViewBag.errmsg = "please selectAny One";
            if (programm.IsActive.Equals("Active") || programm.IsSuccess.Equals("Success"))
            {
                ProgManager.SaveProgramm(programm);
                return View("View1");
            }

            else if (programm.IsActive.Equals("Active") || programm.IsSuccess.Equals("Success"))
            {
                ProgManager.SaveProgramm(programm);
                return View("View1");
            }
            else
            {
                return View("Create");
            }
        }
        /// <summary>
        /// ProgramDetail() get id as input from the list of program  
        /// and display the details about particular program
        /// M.S.Prakash
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult ProgramDetail(int id)
        {
            ViewBag.Dollar = (decimal)dm.GetDollarPrice();
            var detail = pm.GetAll().ToList<Programm>();
            Programm prog = new Programm();

                foreach (var item in detail)
                {

                    if (item.ProgrammId == id)
                    {
                        prog = item;
                    }
                }

            return View(prog);
        }
 public ActionResult Create(Programm save)
 {
     sm.saveSearchProgram(save);
     return View();
 }
Esempio n. 4
0
        public ActionResult Create(Programm p, HttpPostedFileBase PatientPhoto, HttpPostedFileBase PatientVideo, HttpPostedFileBase MedicalAdviceDocumentPath, HttpPostedFileBase DoctorRecommendationDocumentPath, HttpPostedFileBase MedicalConditionDocumentPath, int CityID, int StateID, int CountryID)
        {
            // Request.Files["PatientPhoto"]
            List<Country> countries = locmng.GetAllCountries();
            ViewBag.countrylist = new SelectList(countries.OrderBy(c => c.Name), "CountryID", "Name");
            List<City> citylist = locmng.GetAllCities();
            ViewBag.cities = new SelectList(citylist, "CityID", "Name");
            City cc = new City();
            State ss = new State();
            Country cs = new Country();
            cc.CityID = CityID;
            ss.StateID = StateID;
            cs.CountryID = CountryID;
            p.Address.City = cc;
            p.Address.City.State = ss;
            p.Address.City.State.Country = cs;

            try
            {
                string fileExt = Path.GetExtension(PatientPhoto.FileName);
                switch (fileExt.ToLower())
                {
                    case ".jpg": break;
                    case ".png": break;
                    case ".jpeg": break;
                    case ".gif": break;

                    default:

                        ViewBag.Message1 = "File type must be of the type .jpeg,.jif,.png,.jpg";
                        return View("Create");

                }
            }
            catch (NullReferenceException e)
            {

                ViewBag.Message = "Sorry! no file can be  uploaded";
            }

            try
            {
                string fileExt1 = Path.GetExtension(MedicalAdviceDocumentPath.FileName);
                switch (fileExt1.ToLower())
                {
                    case ".doc": break;
                    case ".pdf": break;
                    case ".txt": break;
                    default:
                        ViewBag.Message2 = "File type must be of the type .doc,.pdf,.txt";
                        return View("List");
                }
            }
            catch (NullReferenceException e)
            {

                ViewBag.Message = "Sorry! no file can be  uploaded";
            }

            try
            {
                string fileExt2 = Path.GetExtension(DoctorRecommendationDocumentPath.FileName);
                switch (fileExt2.ToLower())
                {
                    case ".doc": break;
                    case ".pdf": break;
                    case ".txt": break;
                    default:
                        ViewBag.Message3 = "File type must be of the type .doc,.pdf..txt";
                        return View("Create");
                }
            }
            catch (NullReferenceException e)
            {

                ViewBag.Message = "Sorry! no file can be  uploaded";
            }

            try
            {
                string fileExt3 = Path.GetExtension(MedicalConditionDocumentPath.FileName);
                switch (fileExt3.ToLower())
                {
                    case ".doc": break;
                    case ".pdf": break;
                    case ".txt": break;
                    default:
                        ViewBag.Message4 = "The path File type must be of the type .doc,.pdf..txt";
                        return View("Create");
                }
            }
            catch (NullReferenceException e)
            {

                ViewBag.Message = "Sorry! no file can be  uploaded";
            }

            Picture pic = new Picture();
            List<Picture> pc = new List<Picture>();
            Patient patient = new Patient();

            PatientMedicalDetail pmd = new PatientMedicalDetail();
            PatientMedicalDetail pmd1 = new PatientMedicalDetail();
            PatientMedicalDetail pmd2 = new PatientMedicalDetail();
            byte[] array;
            //byte[] array1;
            byte[] array2;
            byte[] array3;
            byte[] array4;

            using (MemoryStream ms = new MemoryStream())
            {
                PatientPhoto.InputStream.CopyTo(ms);
                array = ms.GetBuffer();
                pic.Pictures = array;
                // pic.Pictures = array;
                //pc.Add(pic);

                p.Pictures = pic;
            }

            //using (MemoryStream ms1 = new MemoryStream())
            //{
            //    PatientVideo.InputStream.CopyTo(ms1);
            //    array1 = ms1.GetBuffer();
            //    patient.VideoFilePath = array1;
            //    p.Patient.VideoFilePath = array1;

            //}

            using (MemoryStream ms2 = new MemoryStream())
            {
                MedicalAdviceDocumentPath.InputStream.CopyTo(ms2);
                array2 = ms2.GetBuffer();
                pmd.MedicalAdviceDocument = array2;
                p.PatientMedicalDetail.MedicalAdviceDocument = array2;
            }

            using (MemoryStream ms3 = new MemoryStream())
            {
                DoctorRecommendationDocumentPath.InputStream.CopyTo(ms3);
                array3 = ms3.GetBuffer();
                pmd1.DoctorRecommendationDocument = array3;
                p.PatientMedicalDetail.DoctorRecommendationDocument = array3;
            }

            using (MemoryStream ms4 = new MemoryStream())
            {
                MedicalConditionDocumentPath.InputStream.CopyTo(ms4);
                array4 = ms4.GetBuffer();
                pmd2.MedicalAdviceDocument = array4;
                p.PatientMedicalDetail.MedicalConditionDocument = array4;
            }

            if (PatientPhoto == null)
            {
                p.Pictures = null;
            }

            if (PatientVideo == null)
            {
                p.Patient.VideoFilePath = null;
            }

            if (MedicalAdviceDocumentPath == null)
            {
                p.PatientMedicalDetail.MedicalAdviceDocument = null;
            }

            if (DoctorRecommendationDocumentPath == null)
            {
                p.PatientMedicalDetail.DoctorRecommendationDocument = null;
            }

            if (MedicalConditionDocumentPath == null)
            {
                p.PatientMedicalDetail.MedicalConditionDocument = null;
            }

            pm.SaveProgram(p);
            return View("CreateSuccess");
        }
Esempio n. 5
0
 /// <summary>
 /// view method for listing all the Programs
 /// </summary>
 public ActionResult List(Programm pgm, int? page)
 {
     ViewBag.Dollar = (decimal)dm.GetDollarPrice();
     List<Programm> allPrograms = pm.GetAllPrograms();
     return View(allPrograms.ToList<Programm>().ToPagedList<Programm>(page ?? 1, 3));
 }
Esempio n. 6
0
        public ActionResult Edit(Programm prg)
        {
            pm.UpdateProgram(prg);

            return View("EditSuccess");
        }
Esempio n. 7
0
 public void update(Programm programm)
 {
     repository.Update(programm);
 }
Esempio n. 8
0
 //void IProgrammManager.SaveProgramm(Programm programm)
 //{
 //    repository.Create(programm);
 //}
 //IList<Programm> IProgrammManager.GetSuccessStories()
 //{
 //    return repository.All().ToList<Programm>();
 //}
 public void SaveProgramm(Programm programm)
 {
     //repository.Create(programm);
        repository.Create(programm);
 }