//-----------------------------------------------
[AllowAnonymous]
public ActionResult 함수_페이지(string reftype = null)
{
return View(new Tuple<클래스타입1, 클래스타입2[], 클래스타입3[], 클래스타입4[]>(객체1, 객체2, 객체3, 객체4));
}
@using Model.Common
@model Tuple<클래스타입1, 클래스타입2[], 클래스타입3[], 클래스타입4[]>
//-----------------------------------------------
[AllowAnonymous, ChildActionOnly]
public PartialViewResult 함수_Partial()
{
return PartialView(new Tuple<Banner>(adBanner));
}
@using Model.Common
@model Tuple<Banner>
@Html.Action("함수_Partial", "Main")
[HttpPost]
public JsonResult 함수_기능(int Idx)
{
//return Json(new {객체1, 객체2});
return Json(객체);
}
//-----------------------------------------------
[NonAction]
private object 함수_기능()
{
return list.Select(x => new
{
PROD_NUM = x.PROD_NUM,
IDX = x.IDX
});
}
//-----------------------------------------------
[FilterConfig.cs]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = true)]
public class UserAuthorizationAttribute : FilterAttribute, IAuthorizationFilter
{
public RoleType Role { get; set; }
public void OnAuthorization(AuthorizationContext filterContext)
{
if ((Role & RoleType.Wos) == RoleType.Wos)
{
if (!전역_객체.IsWos) // Wos가 아니면
{
throw new Exception("Wos 권한이 없습니다.");
}
}
}
}
[Flags]
public enum RoleType
{
Wos
}
[View1.cs]
[UserAuthorization(Role = RoleType.Wos)]
public ActionResult WosCart(string cList)
{
ViewBag.Name = Common.객체1.Name;
return View(Json(cList));
}
//-----------------------------------------------
private Dictionary<string, string> GetParameterResultMap(string parameter)
{
// + 기호가 공백으로 넘어 오는경우 처리
string decString = parameter.Replace(" ","+");
Dictionary<string, string> resultMap = parseStringToMap(decString);
return resultMap;
}
public static System.Collections.Generic.Dictionary<string, string> parseStringToMap(string text)
{
System.Collections.Generic.Dictionary<string, string> retMap = new System.Collections.Generic.Dictionary<string, string>();
if (string.IsNullOrEmpty(text) || string.IsNullOrWhiteSpace(text))
return retMap;
string[] arText = text.Split('&');
for (int i = 0; i < arText.Length; i++)
{
string[] arKeyVal = arText[i].Split('=');
retMap.Add(arKeyVal[0], arKeyVal[1]);
}
return retMap;
}
//-----------------------------------------------
public enum CancelState : int
{
[Description("취소요청")]
RequestCancel = 0,
[Description("취소대기")]
ProcessingCancel = 1,
[Description("취소불가")]
ImpossibleCancel = 2,
[Description("취소완료")]
CompleteCancel = 3
}
//-----------------------------------------------
public class InicisRequest
{
#region 기본 데이터 필드
[Required]
[StringLength(20)]
public string version { get; set; }
[Required]
[StringLength(10)]
public string mid { get; set; }
[Required]
public int price { get; set; }
public int tax { get; set; }
:
#endregion
}
#endregion
}
댓글 없음:
댓글 쓰기