public int Post(Models.Event value)
        {
            try
            {
                Data.MstEvent NewEvent = new Data.MstEvent();

                SqlDateTime EventDate = new SqlDateTime(new DateTime(Convert.ToDateTime(value.EventDate).Year, +
                                                                     Convert.ToDateTime(value.EventDate).Month, +
                                                                     Convert.ToDateTime(value.EventDate).Day));


                NewEvent.EventDate        = EventDate.Value;
                NewEvent.EventDescription = value.EventDescription;
                NewEvent.Particulars      = value.Particulars;
                NewEvent.URL          = value.URL;
                NewEvent.VideoURL     = value.VideoURL;
                NewEvent.EventType    = value.EventType;
                NewEvent.IsRestricted = value.IsRestricted;
                NewEvent.IsArchived   = value.IsArchived;

                db.MstEvents.InsertOnSubmit(NewEvent);
                db.SubmitChanges();

                return(NewEvent.Id);
            }
            catch
            {
                return(0);
            }
        }
        public HttpResponseMessage Delete(int Id)
        {
            Data.MstEvent DeleteEvent = db.MstEvents.Where(d => d.Id == Id).First();

            if (DeleteEvent != null)
            {
                db.MstEvents.DeleteOnSubmit(DeleteEvent);
                try
                {
                    db.SubmitChanges();
                    return(Request.CreateResponse(HttpStatusCode.OK));
                }
                catch
                {
                    return(Request.CreateResponse(HttpStatusCode.BadRequest));
                }
            }
            else
            {
                return(Request.CreateResponse(HttpStatusCode.NotFound));
            }
        }