예제 #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;
 }
예제 #4
0
 public HttpResponseMessage SaveSite(SiteModel siteModel)
 {
     SecurityClientProcessor.SaveSite(siteModel);
     return Request.CreateResponse(HttpStatusCode.OK, new { Message = CoreMessages.SavedSuccessfully, Id = siteModel.SiteId });
 }