Esempio n. 1
0
        public static Boolean UpdateOne(BLL.CalendarEvent calEvent)
        {
            int rows = 0;

            SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["DBCalendar"].ToString());

            SqlCommand comm = new SqlCommand("CalendarEventUpdateOne", con);
            comm.CommandType = CommandType.StoredProcedure;
            comm.Parameters.AddWithValue("@Id", calEvent.GetId());
            comm.Parameters.AddWithValue("@Date", calEvent.CalendarDate);
            comm.Parameters.AddWithValue("@Title", calEvent.Title);
            comm.Parameters.AddWithValue("@Detail", calEvent.Detail);

            try
            {
                con.Open();

                rows = comm.ExecuteNonQuery();
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e);
            }
            finally
            {
                con.Close();
            }

            return (rows > 0);
        }