Ejemplo n.º 1
0
 public void ListImgr1(Auth auth, List_Imgr1 request, List_Imgr1_Logic list_Imgr1_Logic, CommonResponse ecr, string[] token, string uri)
 {
     if (auth.AuthResult(token, uri))
     {
         ecr.data.results = list_Imgr1_Logic.GetList(request);
         ecr.meta.code = 200;
         ecr.meta.message = "OK";
     }
     else
     {
         ecr.meta.code = 401;
         ecr.meta.message = "Unauthorized";
     }
 }
Ejemplo n.º 2
0
 public object Any(List_Login request)
 {
     CommonResponse ecr = new CommonResponse();
     ecr.initial();
     try
     {
         LoginService ls = new LoginService();
         ls.initial(auth, request, list_Login_Logic, ecr, this.Request.Headers.GetValues("Signature"), this.Request.RawUrl);
     }
     catch (Exception ex){
         ecr.meta.code = 599;
         ecr.meta.message = "The server handle exceptions, the operation fails.";
         ecr.meta.errors.code = ex.HResult;
         ecr.meta.errors.field = ex.HelpLink;
         ecr.meta.errors.message = ex.Message.ToString();
     }
     return ecr;
 }
Ejemplo n.º 3
0
 public void initial(Auth auth, Update_Done request, Update_Done_Logic eventdoneLogic, CommonResponse ecr, string[] token, string uri)
 {
     if (auth.AuthResult(token, uri))
     {
         if (eventdoneLogic.UpdateDone(request) > 0)
         {
             ecr.meta.code = 200;
             ecr.meta.message = "OK";
         }
         else
         {
             ecr.meta.code = 612;
             ecr.meta.message = "The specified resource does not exist";
         }
     }
     else
     {
         ecr.meta.code = 401;
         ecr.meta.message = "Unauthorized";
     }
 }
Ejemplo n.º 4
0
 public void initial(Auth auth, List_Login request, List_Login_Logic eventloginLogic, CommonResponse ecr, string[] token, string uri)
 {
     if (auth.AuthResult(token, uri))
     {
         if (eventloginLogic.LoginCheck(request) > 0)
         {
             ecr.meta.code = 200;
             ecr.meta.message = "OK";
             ecr.data.results = request.UserId;
         }
         else
         {
             ecr.meta.code = 612;
             ecr.meta.message = "Invalid User";
         }
     }
     else
     {
         ecr.meta.code = 401;
         ecr.meta.message = "Unauthorized";
     }
 }
Ejemplo n.º 5
0
 public void ListImgr2(Auth auth, List_Imgr2 request, List_Imgr2_Logic list_Imgr2_Logic, CommonResponse ecr, string[] token, string uri)
 {
     if (auth.AuthResult(token, uri))
     {
         ecr.data.results = list_Imgr2_Logic.GetList(request);
         if (ecr.data.results != null)
         {
             ecr.meta.code = 200;
             ecr.meta.message = "OK";
         }
         else
         {
             ecr.meta.code = 612;
             ecr.meta.message = "The specified resource does not exist";
         }
     }
     else
     {
         ecr.meta.code = 401;
         ecr.meta.message = "Unauthorized";
     }
 }