public void insert() { vitalusEntities objvt = new vitalusEntities(); Sleepdiary sd = new Sleepdiary(); try { sd.Login_id = Convert.ToInt16(Session["LoginId"].ToString()); sd.Night = Convert.ToInt32(night.SelectedValue); sd.DateStart = Convert.ToDateTime(datestart.Value); sd.Prescription = prescription.SelectedValue; sd.beverages = beverages.Value; sd.caffeinated = caffeinated.Value; //sd.turnofftime sd.sleephours = Convert.ToInt32(sleephour.Value); sd.sleepminutes = Convert.ToInt32(sleepmin.Value); sd.wokeup = wokeup.Value; sd.totaltime = totaltime.Value; sd.turnofftime = TimeSpan.Parse(turnofftime.Value); sd.totalsleephours = Convert.ToInt32(totalsleephours.Value); sd.totalsleepmin = Convert.ToInt32(totalsleepmin.Value); objvt.Sleepdiaries.Add(sd); objvt.SaveChanges(); string script3 = "alert('Successfully Submited!');"; ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", script3, true); } catch (Exception e) { string script3 = "alert('All Fields Are Mandatory');"; ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", script3, true); } }
public int insertData() { try { vitalusEntities objvt = new vitalusEntities(); Questionnare objq = new Questionnare(); //firstTab objq.Login_id = Convert.ToInt16(Session["LoginId"].ToString()); objq.Firstname = firstn.Value; objq.Middlename = middlen.Value; objq.Lastname = lastn.Value; objq.Weight = Convert.ToInt32(weight.Value); objq.Age = Convert.ToInt32(age.Value); objq.Gender = gender.SelectedItem.Value; objq.height_feet = Convert.ToInt32(heightinfeet.Value); objq.height_inches = Convert.ToInt32(heightinches.Value); objq.DateofBirth = DOB.Value; ////SecondTab objq.HighBloodPressure = HighBlood.SelectedValue; objq.HeartDisease = HeartDisease.SelectedValue; objq.Diabetes = Diabetes.SelectedValue; objq.RestLessSyndrome = RestlessLeg.SelectedValue; objq.SleepApnea = SleepApnea.SelectedValue; objq.Insomnia = Insomni.SelectedValue; objq.Narcolepsy = Narcolepsy.SelectedValue; objq.Depression = Depression.SelectedValue; objq.Stroke = Stroke.SelectedValue; objq.AMHeadaches = Headaches.SelectedValue; ////ThirdTab objq.SittingandReading = Convert.ToInt32(Sittingandreading.SelectedValue); objq.WatchingTV = Convert.ToInt32(WatchingTV.SelectedValue); objq.Sittinginactive = Convert.ToInt32(Sittinginactive.SelectedValue); objq.AsPassenger = Convert.ToInt32(passenger.SelectedValue); objq.LyingDown = Convert.ToInt32(afternoon.SelectedValue); objq.SittingTalking = Convert.ToInt32(Sittingandtalking.SelectedValue); objq.SittingQuietly = Convert.ToInt32(Sittingquietly.SelectedValue); objq.InCar = Convert.ToInt32(whilestopped.SelectedValue); ////FourthTab objq.DifficultyFallingaseelp = fallingasleep.SelectedValue; objq.DifficultyStayingaseelp = stayingasleep.SelectedValue; objq.ProblemWaking = problemwakingup.SelectedValue; objq.SleepProblem = sleepproblem.SelectedValue; objq.DrinkAlcohol = drinkalcoholic.SelectedValue; objq.Beverages = beverage.SelectedValue; ////FifthTab objq.LegsAtNight = legsatnight.SelectedValue; objq.Vivid = vivid.SelectedValue; objq.Snored = snored.SelectedValue; objq.Choking = choking.SelectedValue; objq.StopBreathing = stopbreathing.SelectedValue; objq.Medication = medication.SelectedValue; objq.OvertheCounter = overthecounter.SelectedValue; ////SixthTab objq.Ambien = Ambien.SelectedValue; objq.Lunesta = Lunesta.SelectedValue; objq.Halcion = Halcion.SelectedValue; objq.Rozerem = Rozerem.SelectedValue; objq.Sonata = Sonata.SelectedValue; objq.Restoril = Restoril.SelectedValue; objq.Intermezzo = Intermezzo.SelectedValue; objq.Silenor = Silenor.SelectedValue; objq.Xanax = Xanax.SelectedValue; objq.NarcoticForPain = Narcotic.SelectedValue; objq.HighBloodPressure = HighBlood.SelectedValue; objq.Steroid = Steroid.SelectedValue; objq.HeartDisease = HeartDisease.SelectedValue; objq.AntiDepressant = Antidepressant.SelectedValue; objq.Parkinson = Parkinson.SelectedValue; objq.Antihistamines = Antihistamines.SelectedValue; objq.Anitanxiety = anxiety.SelectedValue; objq.Simulant = Stimulant.SelectedValue; objvt.Questionnares.Add(objq); objvt.SaveChanges(); string script3 = "alert('Successfully Updated!');"; ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", script3, true); return(1); } catch (Exception ex) { string script3 = "alert('All Fields Are Mandatory');"; ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", script3, true); return(0); } }
public void Select() { vitalusEntities objvt = new vitalusEntities(); }