コード例 #1
0
    public bool commitUpdateAdvice(int _level, string _advice)   //  UPDATE a level of advice
    {
        hospitalDataContext objHospital = new hospitalDataContext();

        using (objHospital)
        {
            mic_advice objAdvice   = new mic_advice();
            var        objUpAdvice = objHospital.mic_advices.Single(x => x.level == _level);
            objAdvice.advice = _advice;
            objHospital.SubmitChanges();
            return(true);
        }
    }
コード例 #2
0
    public bool commitDeleteAdvice(int _level)   //  DELETE a level of advice
    {
        hospitalDataContext objHospital = new hospitalDataContext();

        using (objHospital)
        {
            mic_advice objAdvice    = new mic_advice();
            var        objDelAdvice = objHospital.mic_advices.Single(x => x.level == _level);
            objHospital.mic_advices.DeleteOnSubmit(objDelAdvice);
            objHospital.SubmitChanges();
            return(true);
        }
    }
コード例 #3
0
    public bool commitInsertAdvice(string _advice)   //  INSERT a level of advice
    {
        hospitalDataContext objHospital = new hospitalDataContext();

        using (objHospital)
        {
            mic_advice objAdvice = new mic_advice();
            objAdvice.advice = _advice;
            objHospital.mic_advices.InsertOnSubmit(objAdvice);
            objHospital.SubmitChanges();
            return(true);
        }
    }