Ejemplo n.º 1
0
        // **************** ADD NEW Even *********************
        public bool AddEventDetailStatus(EventDetailStatusModels Emodel)
        {
            int EventID = Convert.ToInt16(Emodel.EventDetailstatusID);

            connection();
            SqlCommand cmd = new SqlCommand("ProcEventDetailsStatus", con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@EventDetailsStatusID", EventID);
            cmd.Parameters.AddWithValue("@EventDetailstatusName", Emodel.EventDetailstatus.ToString());
            try
            {
                con.Open();
                cmd.ExecuteNonQuery();
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
            finally
            {
                con.Close();
                con.Dispose();
            }
            return(true);
        }
Ejemplo n.º 2
0
        // ***************** UPDATE Event DETAILS *********************
        public bool UpdateDetails(EventDetailStatusModels Emodel)
        {
            connection();
            SqlCommand cmd = new SqlCommand("UpdateProcEventDetailsStatus", con);

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.AddWithValue("@EventDetailstatusID", Emodel.EventDetailstatusID);
            cmd.Parameters.AddWithValue("@EventDetailstatusName", Emodel.EventDetailstatus);

            con.Open();
            int i = cmd.ExecuteNonQuery();

            con.Close();

            if (i >= 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }