Exemple #1
0
 public IQueryable<patient_survey> getpatient_survey()
 {
     
     surveyDataContext objSurveyDC = new surveyDataContext();
     var allSurveys = objSurveyDC.patient_surveys.Select(x => x);
     return allSurveys;
 }
Exemple #2
0
    public IQueryable<patient_survey> getpatient_surveyByID(int _id)
    {
        surveyDataContext objSurveyDC = new surveyDataContext();
        var allSurveys = objSurveyDC.patient_surveys.Where(x => x.Id == _id).Select(x => x);
        return allSurveys;

    }
Exemple #3
0
 public bool commitDelete(int _id)
 {
     surveyDataContext objSurveyDC = new surveyDataContext();
     using (objSurveyDC)
     {
         var objDelSurvey = objSurveyDC.patient_surveys.Single(x => x.Id == _id);
         objSurveyDC.patient_surveys.DeleteOnSubmit(objDelSurvey);
         objSurveyDC.SubmitChanges();
         return true;
         //return "Delete successful";
     }
 }
Exemple #4
0
    public bool commitUpdate(int _id, string _fname, string _lname, string _email, string _review, string _msg)
    {
        surveyDataContext objSurveyDC = new surveyDataContext();
        using (objSurveyDC)
        {
            var objUpSurvey = objSurveyDC.patient_surveys.Single(x => x.Id == _id);
            objUpSurvey.firstname = _fname;
            objUpSurvey.lastname = _lname;
            objUpSurvey.email = _email;
            objUpSurvey.reviewof = _review;
            objUpSurvey.message = _msg;

            objSurveyDC.SubmitChanges();
            return true;
            //return "Update successful";
        }
    }
Exemple #5
0
    public bool commitInsert(string _fname, string _lname, string _email, string _review, string _msg)
    {
        surveyDataContext objSurveyDC = new surveyDataContext();
        using (objSurveyDC)
        {
            patient_survey objSurvey = new patient_survey();
            objSurvey.firstname = _fname;
            objSurvey.lastname = _lname;
            objSurvey.email = _email;
            objSurvey.reviewof = _review;
            objSurvey.message = _msg;

            objSurveyDC.patient_surveys.InsertOnSubmit(objSurvey);
            objSurveyDC.SubmitChanges();
            return true;
            //return "Insert complete";
        }
    }
    //protected void subSubmit(object sender, EventArgs e)
    //{
    //    _strMessage(objSurvey.commitInsert(txtFname.Text, txtLname.Text, txtEmail.Text, txtReview.Text, txtMsg.Text), "insert");
    //    _subRebind();
    //}
    protected void subAddReview(object sender, CommandEventArgs e)
    {
        surveyDataContext objsurveyDC = new surveyDataContext();
        patient_survey objSurvey = new patient_survey();
        objSurvey.firstname = txtFname.Text;
        objSurvey.lastname = txtLname.Text;
        objSurvey.email = txtEmail.Text;
        objSurvey.reviewof = txtReview.Text;
        objSurvey.message = txtMsg.Text;

        objsurveyDC.patient_surveys.InsertOnSubmit(objSurvey);
        objsurveyDC.SubmitChanges();
        txtFname.Text = "";
        txtLname.Text = "";
        txtEmail.Text = "";
        txtReview.Text = "";
        txtMsg.Text = "";
        lbl_ty.Text = "Thank you for your review! It has been submitted.";

    }