Example #1
0
        public static bool UpdateApoitment(int id, string update, string result, bool date)
        {
            var      conn     = new DataLayer.DataClasses1DataContext();
            Activity activity = (from a in conn.Activity
                                 where a.id_act == id
                                 select a).SingleOrDefault();

            if (activity != null)
            {
                if (date == true)
                {
                    activity.dt_fin_cancel = DateTime.Today;
                }
                else
                {
                    activity.dt_fin_cancel = null;
                }
                activity.status = update;
                activity.result = result;
                try
                {
                    conn.SubmitChanges();
                    return(true);
                }
                catch
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }