예제 #1
0
파일: ClientModel.cs 프로젝트: cmcginn/AIM
 public object GetClientParametersObject(ClientModel model)
 {
     object result = null;
     switch (model.ImportTypeId)
     {
         case 1:
             if (model.ClientParameters == null)
             {
                 using (DomainContext ctx = new DomainContext())
                 {
                     Manager mgr = new Manager(ctx);
                     var existingProperties = ctx.Client.SingleOrDefault(x => x.Id == model.Id);
                     if (existingProperties != null)
                     {
                         model.ClientParameters = existingProperties.ClientParameters;
                         result = new MindBodyParameters
                             {
                                 StudioID = model.ClientParameters.Element("StudioID").Value,
                                 Sourcename = model.ClientParameters.Element("Sourcename").Value,
                                 Password = model.ClientParameters.Element("Password").Value
                             };
                     }
                     else
                     {
                         result = new MindBodyParameters();
                     }
                 }
             }
             break;
         default:
             break;
     }
     return result;
 }
예제 #2
0
파일: ClientModel.cs 프로젝트: cmcginn/AIM
 ClientParametersObject GetClientParametersObject(ClientModel model, NameValueCollection requestParameters)
 {
     ClientParametersObject result = new ClientParametersObject();
     if (model.ImportTypeId == 1)
     {
         MindBodyParameters parameters = new MindBodyParameters();
         parameters.StudioID = requestParameters["ClientParametersStudioID"];
         parameters.Sourcename = requestParameters["ClientParametersSourcename"];
         parameters.Password = requestParameters["ClientParametersPassword"];
         result = parameters;
     }
     return result;
 }