Beispiel #1
0
        public Model.APIInfoReturn Validate(string SuricatoKey, string Company, string AccountKey, string Email, string MacAddress, string Password)
        {
            Model.APIInfoReturn api_return_info = new Model.APIInfoReturn();

            try
            {
                Model.User.ResquestAuth parameters = new Model.User.ResquestAuth()
                {
                    suricato_key    = SuricatoKey,
                    mac_address     = MacAddress,
                    tipo_empregador = "1", //fixo
                    matricula       = AccountKey,
                    password        = Password,
                    versao_sistema  = "ANDROID 4.0",
                    empregador      = Company
                };

                string retorno_api = ServicesHttpFactory.Post(Routes.AUTENTICACAO, parameters, "");

                api_return_info = new Wrappers.JsonToModel().ConvertJsonToModel <Model.APIInfoReturn>(retorno_api);

                return(api_return_info);
            }
            catch (Exception err)
            {
                Console.WriteLine(err.Message);
                return(null);
            }
        }
Beispiel #2
0
        public Model.APIInfoReturn CreateAccountData(string SuricatoKey, string Company, string AccountKey, string Email, string MacAddress)
        {
            Model.APIInfoReturn account = new Model.APIInfoReturn();

            try
            {
                //SURICATO_KEY
                //MAC_ADDRESS
                //TIPO_EMPREGADO
                //MATRICULA
                //PASSWORD
                //VERSAO_SISTEMA
                //CNPJ

                Dictionary <string, string> parameters = new Dictionary <string, string>();
                parameters.Add("SURICATO_KEY", SuricatoKey);
                parameters.Add("MAC_ADDRESS", MacAddress);
                parameters.Add("TIPO_EMPREGADO", "1");
                parameters.Add("MATRICULA", AccountKey);
                parameters.Add("PASSWORD", "XPTO1234");
                parameters.Add("VERSAO_SISTEMA", "ANDROID 4.0");
                parameters.Add("EMPREGADOR", Company);

                string retorno_api = ServicesHttpFactory.Post(Routes.CONTA, parameters, "");

                account = new Wrappers.JsonToModel().ConvertJsonToModel <Model.APIInfoReturn>(retorno_api);

                return(account);
            }
            catch (Exception err)
            {
                Console.WriteLine(err.Message);
                return(null);
            }
        }