Ejemplo n.º 1
0
        public string ProcessRequest(Request request)
        {
            if (Context.Users.ContainsKey(request.UserName)) return Context.RegisterResultMessages["Fail"];

            Context.Users.Add(request.UserName, request.Password);
            return Context.RegisterResultMessages["Ok"];
        }
Ejemplo n.º 2
0
 private static Request BuildRequest(string[] line)
 {
     var command = GetRequestCommand(line[0]);
     var request = new Request()
     {
         Command = command,
         UserName = line[1]
     };
     if (command != Command.logout)
     {
         request.Password = line[2];
     }
     return request;
 }
Ejemplo n.º 3
0
 public static string PrecessReqest(Request request)
 {
     return strategies[request.Command].ProcessRequest(request);
 }