예제 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("id,Text,LangId")] FooterInfo footerInfo)
        {
            if (id != footerInfo.id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(footerInfo);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FooterInfoExists(footerInfo.id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(footerInfo));
        }
    void BindInfo()
    {
        FooterInfo fi = FooterInfos.FooterInfoGet();

        if (fi != null && !string.IsNullOrEmpty(fi.WFList))
        {
            txtAbout.Text = fi.WFList;
        }
    }
    void BindInfo()
    {
        FooterInfo fi = FooterInfos.FooterInfoGet();

        if (fi != null && !string.IsNullOrEmpty(fi.HonerUser))
        {
            txtAbout.Text = fi.HonerUser;
        }
    }
예제 #4
0
    void BindInfo()
    {
        FooterInfo fi = FooterInfos.FooterInfoGet();

        if (fi != null && !string.IsNullOrEmpty(fi.RightNotice))
        {
            txtAbout.Text = fi.RightNotice;
        }
    }
    void BindInfo()
    {
        FooterInfo fi = FooterInfos.FooterInfoGet();

        if (fi != null && !string.IsNullOrEmpty(fi.ContactInfo))
        {
            txtAbout.Text = fi.ContactInfo;
        }
    }
예제 #6
0
        public IViewComponentResult Invoke()
        {
            var info = new FooterInfo
            {
                Email       = FeedbackConfigSection["Email"],
                PhoneNumber = FeedbackConfigSection["PhoneNumber"]
            };

            return(View(info));
        }
예제 #7
0
        public async Task <IActionResult> Create([Bind("id,Text,LangId")] FooterInfo footerInfo)
        {
            if (ModelState.IsValid)
            {
                _context.Add(footerInfo);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(footerInfo));
        }
예제 #8
0
        public ServiceResult UpdateInfo(FooterInfo footerInfo /*, List<FooterColleague> footerColleagues*/)
        {
            _context.FooterInfo.Update(footerInfo);
            _context.SaveChanges();

            //footerColleagues.ForEach(p => p.FooterId = footerInfo.Id);

            //_context.FooterColleague.UpdateRange(footerColleagues);

            _context.SaveChanges();

            return(ServiceResult.Okay());
        }
    void BindInfos()
    {
        FooterInfo fi = FooterInfos.FooterInfoGet();

        if (fi != null && !string.IsNullOrEmpty(fi.RightNotice))
        {
            ltAbout.Text = fi.RightNotice;
        }
        else
        {
            ltAbout.Text = "暂无介绍。";
        }
    }
    void BindInfos()
    {
        FooterInfo fi = FooterInfos.FooterInfoGet();

        if (fi != null && !string.IsNullOrEmpty(fi.AbouteHuaho))
        {
            ltAbout.Text = fi.AbouteHuaho;
        }
        else
        {
            ltAbout.Text = "暂无介绍。";
        }
    }
    void BindInfos()
    {
        FooterInfo fi = FooterInfos.FooterInfoGet();

        if (fi != null && !string.IsNullOrEmpty(fi.Recruitment))
        {
            ltAbout.Text = fi.Recruitment;
        }
        else
        {
            ltAbout.Text = "暂无招聘信息。";
        }
    }
        public async Task <IActionResult> CreateFooterItem(/*Guid id,*/ [Bind("PageCreateParentId,ContentType,FooterContent")] FooterInfo footerInfo)
        {
            //if (id != pageCreate.pageId)
            //{
            //    return NotFound();
            //}

            if (ModelState.IsValid)
            {
                footerInfo.FooterId = Guid.NewGuid();
                _context.Add(footerInfo);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Edit", new { id = footerInfo.PageCreateParentId }));
            }
            return(View());
        }
예제 #13
0
        public FooterInfo GetFooterInfo()
        {
            FooterInfo footerInfo = new FooterInfo();

            footerInfo.FooterAbout = db.Texts
                                     .Where(current => current.TextType.UrlParam == "footerabout")
                                     .FirstOrDefault();
            footerInfo.ContactAddress = db.Texts
                                        .Where(current => current.UrlParam == "address").FirstOrDefault();
            footerInfo.ContactEmail = db.Texts
                                      .Where(current => current.UrlParam == "email").FirstOrDefault();
            footerInfo.ContactPhone = db.Texts
                                      .Where(current => current.UrlParam == "phone").FirstOrDefault();
            footerInfo.FooterBlogs = db.Blogs.Include(current => current.BlogGroup)
                                     .Where(current => current.IsActive && !current.IsDeleted).OrderBy(current => current.CreationDate).Take(5).ToList();


            return(footerInfo);
        }
예제 #14
0
        public async Task <IActionResult> Change(FooterInfo footerInfo, List <FooterColleagueViewModel> footerColleagues, IFormFile LogoImage, string LogoImageName)
        {
            var files = HttpContext.Request.Form.Files;

            if (LogoImage != null)
            {
                var LogoAddress = await FileUploadHelper.UploadFile(LogoImage);

                if (LogoAddress.Item1.Succeed)
                {
                    footerInfo.Logo = LogoAddress.Item2;
                }
            }
            if (LogoImageName != null)
            {
                footerInfo.Logo = LogoImageName;
            }

            //var footerColleagueList = new List<FooterColleague>();

            //foreach (var item in footerColleagues)
            //{
            //    var footerColleagueAddress = await FileUploadHelper.UploadFile(item.ImageName);

            //    var entity = new FooterColleague();

            //    Mapper.Map(item, entity);

            //    if (footerColleagueAddress.Item1.Succeed)
            //    {
            //         entity.Image= footerColleagueAddress.Item2;
            //    }
            //    footerColleagueList.Add(entity);
            //}

            //آپلود عکس های همکاران
            var result = _FooterRepository.UpdateInfo(footerInfo);

            TempData.AddResult(result);

            return(RedirectToAction(nameof(Change)));
        }
예제 #15
0
        public FooterFullDTO GetInfo()
        {
            var FooterInfo      = _context.FooterInfo.FirstOrDefault();
            var FooterColleague = _context.FooterColleague.ToList();

            if (FooterInfo == null)
            {
                FooterInfo = new FooterInfo();
            }

            if (FooterColleague == null)
            {
                FooterColleague = new List <FooterColleague>();
            }

            return(new FooterFullDTO
            {
                FooterInfo = FooterInfo,
                FooterColleague = FooterColleague
            });
        }
 public async Task <IActionResult> EditFooterItem([Bind("PageCreateParentId,ContentType,FooterContent,FooterId")] FooterInfo footerInfo,
                                                  string edit, string delete)
 {
     if (ModelState.IsValid)
     {
         if (!string.IsNullOrEmpty(delete))
         {
             var footer = _context.FooterInfo
                          .Where(pi => pi.FooterId == footerInfo.FooterId)
                          .FirstOrDefault();
             _context.Remove(footer);
             await _context.SaveChangesAsync();
         }
         else if (!string.IsNullOrEmpty(edit))
         {
             _context.Update(footerInfo);
             await _context.SaveChangesAsync();
         }
         return(RedirectToAction("Edit", new { id = footerInfo.PageCreateParentId }));
     }
     return(View());
 }