Ejemplo 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;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Create a new RegistrationCode object.
 /// </summary>
 /// <param name="codeId">Initial value of the codeId property.</param>
 public static RegistrationCode CreateRegistrationCode(global::System.Int64 codeId)
 {
     RegistrationCode registrationCode = new RegistrationCode();
     registrationCode.codeId = codeId;
     return registrationCode;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the RegistrationCodes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToRegistrationCodes(RegistrationCode registrationCode)
 {
     base.AddObject("RegistrationCodes", registrationCode);
 }