コード例 #1
0
        public object DeleteEventType(EventTypeUpdateParam PM)
        {
            try
            {
                Tbl_EventType_Master obj = db.Tbl_EventType_Master.Where(r => r.EventTypeID == PM.EventTypeID).FirstOrDefault();


                if (obj.Status == 1)
                {
                    obj.Status = 0;
                }
                else
                {
                    obj.Status = 1;
                }

                db.SaveChanges();

                return(new Result()
                {
                    IsSucess = true, ResultData = "Event Type Deactivated Successfully."
                });
            }
            catch (Exception e)
            {
                return(new Error()
                {
                    IsError = true, Message = e.Message
                });
            }
        }
コード例 #2
0
        public object EventTypeUpdate(EventTypeUpdateParam b)
        {
            if (b.EventType == null)
            {
                return(new Error()
                {
                    IsError = true, Message = "Required Event Type"
                });
            }
            var data = db.Tbl_EventType_Master.Where(r => r.EventTypeID == b.EventTypeID).FirstOrDefault();

            try
            {
                Tbl_FeeType_Master obj = new Tbl_FeeType_Master();
                data.EventType    = b.EventType;
                data.ModifiedBy   = null;
                data.ModifiedDate = System.DateTime.Today.Date;
                db.SaveChanges();
                return(new Result()
                {
                    IsSucess = true, ResultData = "Update Event Type"
                });
            }
            catch (Exception e)
            {
                return(new Error()
                {
                    IsError = true, Message = e.Message
                });
            }
        }
コード例 #3
0
 public object DeleteEventType([FromBody] EventTypeUpdateParam PM)
 {
     try
     {
         EventTypeBusiness b = new EventTypeBusiness();
         var Result          = b.DeleteEventType(PM);
         return(Result);
     }
     catch (Exception e)
     {
         return(new Error()
         {
             IsError = true, Message = e.Message
         });
     }
 }
コード例 #4
0
        public object UpdateEventType(EventTypeUpdateParam b)
        {
            try
            {
                EventTypeBusiness type = new EventTypeBusiness();
                var Result             = type.EventTypeUpdate(b);

                return(Result);
            }
            catch (Exception e)
            {
                return(new Error()
                {
                    IsError = true, Message = e.Message
                });
            }
        }
コード例 #5
0
 public object GetSingleEventType(EventTypeUpdateParam b)
 {
     try
     {
         var Event = db.ViewEventTypeLists.Where(r => r.EventTypeID == b.EventTypeID).FirstOrDefault();
         return(new Result()
         {
             IsSucess = true, ResultData = Event
         });
     }
     catch (Exception e)
     {
         return(new Error()
         {
             IsError = true, Message = e.Message
         });
     }
 }