public IActionResult UploadImage(IList <IFormFile> files)
        {
            IFormFile uploadedImage = files.FirstOrDefault();

            if (uploadedImage == null || uploadedImage.ContentType.ToLower().StartsWith("image/"))
            {
                MemoryStream ms = new MemoryStream();
                uploadedImage.OpenReadStream().CopyTo(ms);

                System.Drawing.Image image = System.Drawing.Image.FromStream(ms);

                Models.Image imageEntity = new Models.Image()
                {
                    Id          = Guid.NewGuid(),
                    Name        = uploadedImage.FileName,
                    Data        = ms.ToArray(),
                    Width       = image.Width,
                    Height      = image.Height,
                    ContentType = uploadedImage.ContentType
                };

                _context.Images.Add(imageEntity);

                _context.SaveChanges();
            }


            return(RedirectToAction("Index"));
        }
        public ActionResult enrollupdatefee(ListModel data)
        {
            if (string.IsNullOrEmpty(HttpContext.Session.GetString("Session1")))
            {
                return(RedirectToAction("UserLogin", "Login"));
            }
            data.EnrollModel.paystatusid = data.EnrollModel.paystatusid.Remove(data.EnrollModel.paystatusid.Length - 1, 1);
            string[] paidid = data.EnrollModel.paystatusid.Split(",");

            foreach (var item1 in paidid)
            {
                string[] modes = item1.Split(".");
                var      res   = _context.Admissiopay.Find(data.EnrollModel.AdId, Convert.ToInt32(modes[0]));
                res.Paystatus = true;
                res.PayDate   = Convert.ToDateTime(modes[1]);
                if (modes[2].ToString() == "1")
                {
                    res.Pay_mode = "Cash";
                }
                else if (modes[2].ToString() == "2")
                {
                    res.Pay_mode   = "Cheque";
                    res.Chequeno   = modes[3].ToString();
                    res.Chequedt   = Convert.ToDateTime(modes[4]);
                    res.BankName   = modes[5].ToString();
                    res.BankBranch = modes[6].ToString();
                }
                else if (modes[2].ToString() == "3")
                {
                    res.Pay_mode      = "netbanking";
                    res.Transactionno = modes[3].ToString();
                }
                _context.SaveChanges();
            }

            ViewBag.display = "div4";
            ViewBag.ADID    = data.EnrollModel.AdId;
            return(View("FeePay", data));
        }
 public void Update(Admissiopay entity)
 {
     context.Admissiopay.Update(entity);
     context.SaveChanges();
 }
 public void Create(T entity)
 {
     context.Add(entity);
     context.SaveChanges();
 }