public ActionResult Create(SURVEY survey)
        {
            survey.datestamp = DateTime.Now;
            survey.user_stamp = 1;
            survey.survey_status = "A";

            if (ModelState.IsValid)
            {
                db.SURVEYs.AddObject(survey);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(survey);
        }
 public ActionResult Edit(SURVEY survey)
 {
     if (ModelState.IsValid)
     {
         db.SURVEYs.Attach(survey);
         db.ObjectStateManager.ChangeObjectState(survey, EntityState.Modified);
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(survey);
 }
 /// <summary>
 /// Create a new SURVEY object.
 /// </summary>
 /// <param name="survey_id">Initial value of the survey_id property.</param>
 /// <param name="title">Initial value of the title property.</param>
 /// <param name="survey_status">Initial value of the survey_status property.</param>
 /// <param name="lifetime">Initial value of the lifetime property.</param>
 /// <param name="datestamp">Initial value of the datestamp property.</param>
 /// <param name="user_stamp">Initial value of the user_stamp property.</param>
 public static SURVEY CreateSURVEY(global::System.Int32 survey_id, global::System.String title, global::System.String survey_status, global::System.Int32 lifetime, global::System.DateTime datestamp, global::System.Int32 user_stamp)
 {
     SURVEY sURVEY = new SURVEY();
     sURVEY.survey_id = survey_id;
     sURVEY.title = title;
     sURVEY.survey_status = survey_status;
     sURVEY.lifetime = lifetime;
     sURVEY.datestamp = datestamp;
     sURVEY.user_stamp = user_stamp;
     return sURVEY;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the SURVEYs EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToSURVEYs(SURVEY sURVEY)
 {
     base.AddObject("SURVEYs", sURVEY);
 }
 /// <summary>
 /// Create a new SURVEY object.
 /// </summary>
 /// <param name="survey_id">Initial value of the survey_id property.</param>
 /// <param name="title">Initial value of the title property.</param>
 /// <param name="header_text">Initial value of the header_text property.</param>
 /// <param name="survey_introduction">Initial value of the survey_introduction property.</param>
 /// <param name="number_of_sections">Initial value of the number_of_sections property.</param>
 /// <param name="survey_status">Initial value of the survey_status property.</param>
 /// <param name="lifetime">Initial value of the lifetime property.</param>
 /// <param name="datestamp">Initial value of the datestamp property.</param>
 /// <param name="user_stamp">Initial value of the user_stamp property.</param>
 public static SURVEY CreateSURVEY(global::System.Int32 survey_id, global::System.String title, global::System.String header_text, global::System.String survey_introduction, global::System.Int32 number_of_sections, global::System.String survey_status, global::System.Int32 lifetime, global::System.DateTime datestamp, global::System.Int32 user_stamp)
 {
     SURVEY sURVEY = new SURVEY();
     sURVEY.survey_id = survey_id;
     sURVEY.title = title;
     sURVEY.header_text = header_text;
     sURVEY.survey_introduction = survey_introduction;
     sURVEY.number_of_sections = number_of_sections;
     sURVEY.survey_status = survey_status;
     sURVEY.lifetime = lifetime;
     sURVEY.datestamp = datestamp;
     sURVEY.user_stamp = user_stamp;
     return sURVEY;
 }