Пример #1
0
 //[ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
 public string GetModelMedicoJson()
 {
     Pot.DataLayer.Medico m = new Pot.DataLayer.Medico();
     m.CodiceFiscale  = "CDCFSC16Z21H" + new Random().Next(100, 999).ToString() + "Z";
     m.PartitaIva     = "123456" + new Random().Next(1000, 9999).ToString() + "1";
     m.CodiceUnivoco  = "ABC" + new Random().Next(1000, 9999).ToString() + "E";
     m.Cognome        = "Cognome Casuale" + new Random().Next(0, 9999).ToString();
     m.Nome           = "Nome Casuale" + new Random().Next(0, 9999).ToString();
     m.RagioneSociale = "Ragione Sociale Casuale" + new Random().Next(0, 9999).ToString();
     m.ComuneNascita  = "Roma";
     m.Nazionalita    = "ITALIA";
     m.DataNascita    = DateTime.Now.Date;
     m.Indirizzo      = "Via di casa, 29";
     m.Comune         = "Ariccia";
     m.Cap            = "00100";
     m.Provincia      = "ROMA";
     m.Iban           = "IT96R0123454321000000012345".Trim();
     return(new JavaScriptSerializer().Serialize(m));
 }
Пример #2
0
        public string SetMedico(string token, string MedicoJson)
        {
            try
            {
                string  userAgent = HttpContext.Current.Request.UserAgent;
                string  ip        = HttpContext.Current.Request.UserHostAddress;
                string  message   = String.Empty;
                Boolean result    = false;

                if (Pot.BusinessLayer.Authentication.IsTokenValid(token, ip, userAgent))
                {
                    Pot.DataLayer.Medico medico = (Pot.DataLayer.Medico) new JavaScriptSerializer().Deserialize(MedicoJson, typeof(Pot.DataLayer.Medico));

                    result = Pot.BusinessLayer.Interface.ExecuteMedico(medico, out message);
                    System.Threading.Thread.Sleep(3 * 1000);
                }

                else
                {
                    message = "Token Expired!";
                    result  = false;
                }

                var response = new { Message = message, Result = result };

                //HTDebug.Debug dbg = new HTDebug.Debug();
                //dbg.DebugLine(String.Format("Configurato Medico {0} - {1}", message, result), System.Diagnostics.EventLogEntryType.Information, 0);

                return(new JavaScriptSerializer().Serialize(response));
            }
            catch (Exception e)
            {
                //HTDebug.Debug dbg = new HTDebug.Debug();
                //dbg.DebugLine(String.Format("Errore Configurazione Medico - {0}", e.Message), System.Diagnostics.EventLogEntryType.Error, 0);

                return(e.Message);
            }
        }