BookMgnt.Controllers.AdminController.SiteInfo C# (CSharp) Method

SiteInfo() private method

private SiteInfo ( InfoSite info, System.Web.HttpPostedFileBase image_banner ) : System.Web.Mvc.ActionResult
info BookMgnt.Models.InfoSite
image_banner System.Web.HttpPostedFileBase
return System.Web.Mvc.ActionResult
        public ActionResult SiteInfo(InfoSite info, HttpPostedFileBase image_banner)
        {
            if (ModelState.IsValid)
            {
                ChangeInfoSite ch = new ChangeInfoSite();
                if (image_banner != null && image_banner.ContentLength > 0)
                {
                    string pic = System.IO.Path.GetFileName(image_banner.FileName);
                    string path = System.IO.Path.Combine(Server.MapPath("~/Content/image"), pic);
                    if (System.IO.File.Exists(path))
                    {
                        int count = 2;
                        while (System.IO.File.Exists(path))
                        {
                            pic = count.ToString() + pic;
                            path = System.IO.Path.Combine(Server.MapPath("~/Content/image"), pic);
                        }
                    }
                    image_banner.SaveAs(path);
                    info.imageName = pic;
                    //ch.SaveInfo(info.Address, info.Email, info.Phone, info.Footer, info.imageName);
                }
                ch.SaveInfo(info.Address, info.Email, info.Phone, info.Footer, info.imageName);

                return RedirectToAction("Contact", "Home");
            }
            return View(info);
        }

Same methods

AdminController::SiteInfo ( ) : System.Web.Mvc.ActionResult