示例#1
0
 /// <summary>
 /// SaveSite
 /// </summary>
 /// <param name="siteModel"></param>
 /// <returns></returns>
 public void SaveSite(SiteModel siteModel)
 {
     SiteDC site = Mapper.Map<SiteModel, SiteDC>(siteModel);
     ServiceResponse<int> saveSiteResponse = _securityProxy.Execute(opt => opt.SaveSite(site));
     if (saveSiteResponse.Status != ResponseStatus.Success)
         HandleError(saveSiteResponse.Status, saveSiteResponse.ResponseMessage);
     else
         siteModel.SiteId = saveSiteResponse.Result;
 }
示例#2
0
 public ActionResult Site(int Id = 0)
 {
     SiteModel siteModel = new SiteModel();
     siteModel.SiteId = Id;
     if (Request.IsAjaxRequest())
         return PartialView(siteModel);
     else
         return View(siteModel);
 }
示例#3
0
 /// <summary>
 /// GetSite
 /// </summary>
 /// <param name="siteId"></param>
 /// <returns></returns>
 public SiteModel GetSite(int siteId)
 {
     SiteModel SiteModel = new SiteModel();
     ServiceResponse<SiteDC> siteResponse = _securityProxy.Execute(opt => opt.GetSite(siteId));
     if (siteResponse.Status == ResponseStatus.Success)
     {
         SiteModel = Mapper.Map<SiteDC, SiteModel>(siteResponse.Result);
     }
     else
     {
         HandleError(siteResponse.Status, siteResponse.ResponseMessage);
     }
     return SiteModel;
 }
 public HttpResponseMessage SaveSite(SiteModel siteModel)
 {
     SecurityClientProcessor.SaveSite(siteModel);
     return Request.CreateResponse(HttpStatusCode.OK, new { Message = CoreMessages.SavedSuccessfully, Id = siteModel.SiteId });
 }