Esempio n. 1
0
        public static string AddPatientInfo(string pname, string padd1, string padd2, string pphone, string pdob, string pmedhis, string ppathis, string pemail, string pmot, Guid dguid)
        {
            GuruETC.DB.GuruETCEntities _etc = new DB.GuruETCEntities();
            string msg = string.Empty;
            string senderDisplayName = string.Empty;
            try
            {

                Patientinfo _pinfo = new Patientinfo();
                _pinfo.Name = pname;
                _pinfo.Address1 = padd1;
                _pinfo.Address2 = padd2;
                _pinfo.DOB = DateTime.Parse(pdob);
                _pinfo.PhoneNumber = pphone;
                _pinfo.MedicalHistory = pmedhis;
                _pinfo.PatientHistorical = ppathis;
                _pinfo.PersonalMotivator = pmot;
                _pinfo.Email = pemail;
                _pinfo.refby = dguid;
                _etc.AddToPatientinfoes(_pinfo);
                _etc.SaveChanges();

                RegistrationCode _rcode = new RegistrationCode();
                _rcode.createdDate = DateTime.Today;
                _rcode.ExpiryDate = DateTime.Today.AddDays(1);
                _rcode.PatientInfoId = _pinfo.PID;
                Guid Getcode = Guid.NewGuid();
                _rcode.RegCode = Getcode;
                _rcode.IsAuth = true;
                _etc.AddToRegistrationCodes(_rcode);
                _etc.SaveChanges();

                ThreadStart starterimg = () => bitMethod(pemail,pname, senderDisplayName, Getcode);
                Thread threadimg = new Thread(starterimg);
                threadimg.ApartmentState = ApartmentState.STA;
                threadimg.Start();
                msg = "Success";

            }

            catch(Exception ex)
            {
                throw ex;
            }
            return msg;
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the Patientinfoes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPatientinfoes(Patientinfo patientinfo)
 {
     base.AddObject("Patientinfoes", patientinfo);
 }
 /// <summary>
 /// Create a new Patientinfo object.
 /// </summary>
 /// <param name="pID">Initial value of the PID property.</param>
 public static Patientinfo CreatePatientinfo(global::System.Int64 pID)
 {
     Patientinfo patientinfo = new Patientinfo();
     patientinfo.PID = pID;
     return patientinfo;
 }
Esempio n. 4
0
 public static Patientinfo IsValidid(string id)
 {
     Patientinfo _getInfo = new Patientinfo();
     GuruETC.DB.GuruETCEntities _etc = new DB.GuruETCEntities();
     try
     {
         Guid getId = Guid.Parse(id);
         RegistrationCode _rcode = _etc.RegistrationCodes.Where(d => d.RegCode == getId && d.ExpiryDate >= DateTime.Today).FirstOrDefault();
         if (_rcode != null)
         {
             _getInfo = _etc.Patientinfoes.Where(d => d.PID == _rcode.PatientInfoId).FirstOrDefault();
         }
     }
     catch
     {
     }
     return _getInfo;
 }