Exemplo n.º 1
0
 public void UpdateStatus(DTO.LABURNUM.COM.EventTypeModel model)
 {
     if (new FrontEndApi.ApiClientApi().IsClientValid(model.ApiClientModel.UserName, model.ApiClientModel.Password))
     {
         new FrontEndApi.EventTypeApi().UpdateIsActive(model);
     }
 }
Exemplo n.º 2
0
 public List <DTO.LABURNUM.COM.EventTypeModel> SearchEventTypeByAdvanceSearch(DTO.LABURNUM.COM.EventTypeModel model)
 {
     if (new FrontEndApi.ApiClientApi().IsClientValid(model.ApiClientModel.UserName, model.ApiClientModel.Password))
     {
         return(new EventTypeHelper(new FrontEndApi.EventTypeApi().GetEventTypeByAdvanceSearch(model)).Map());
     }
     else
     {
         return(null);
     }
 }
Exemplo n.º 3
0
 public long Add(DTO.LABURNUM.COM.EventTypeModel model)
 {
     if (new FrontEndApi.ApiClientApi().IsClientValid(model.ApiClientModel.UserName, model.ApiClientModel.Password))
     {
         return(new FrontEndApi.EventTypeApi().Add(model));
     }
     else
     {
         return(-1);
     }
 }
Exemplo n.º 4
0
 private DTO.LABURNUM.COM.EventTypeModel MapCore(API.LABURNUM.COM.EventType eventType)
 {
     DTO.LABURNUM.COM.EventTypeModel dtoClass = new DTO.LABURNUM.COM.EventTypeModel()
     {
         EventTypeId = eventType.EventTypeId,
         Text        = eventType.Text,
         CreatedOn   = eventType.CreatedOn,
         IsActive    = eventType.IsActive,
         LastUpdated = eventType.LastUpdated
     };
     return(dtoClass);
 }
Exemplo n.º 5
0
 private long AddEventType(DTO.LABURNUM.COM.EventTypeModel model)
 {
     API.LABURNUM.COM.EventType apiEventType = new EventType()
     {
         EventTypeId = model.EventTypeId,
         Text        = model.Text,
         CreatedOn   = new Component.Utility().GetISTDateTime(),
         IsActive    = true
     };
     this._laburnum.EventTypes.Add(apiEventType);
     this._laburnum.SaveChanges();
     return(apiEventType.EventTypeId);
 }
Exemplo n.º 6
0
        public List <API.LABURNUM.COM.EventType> GetEventTypeByAdvanceSearch(DTO.LABURNUM.COM.EventTypeModel model)
        {
            IQueryable <API.LABURNUM.COM.EventType> iQuery = null;

            //SearchBy EventType Id.
            if (model.EventTypeId > 0)
            {
                iQuery = this._laburnum.EventTypes.Where(x => x.EventTypeId == model.EventTypeId && x.IsActive == true);
            }
            //Search By EventTypeId.
            if (iQuery != null)
            {
                if (model.EventTypeId > 0)
                {
                    iQuery = iQuery.Where(x => x.EventTypeId == model.EventTypeId && x.IsActive == true);
                }
            }
            else
            {
                if (model.EventTypeId > 0)
                {
                    iQuery = this._laburnum.EventTypes.Where(x => x.EventTypeId == model.EventTypeId && x.IsActive == true);
                }
            }

            //Search By EventTypeName.
            if (iQuery != null)
            {
                if (model.Text != null)
                {
                    iQuery = iQuery.Where(x => x.Text.Contains(model.Text) && x.IsActive == true);
                }
            }
            else
            {
                if (model.Text != null)
                {
                    iQuery = this._laburnum.EventTypes.Where(x => x.Text.Contains(model.Text) && x.IsActive == true);
                }
            }

            List <API.LABURNUM.COM.EventType> dbEventTypes = iQuery.ToList();

            return(dbEventTypes);
        }
Exemplo n.º 7
0
        public void UpdateIsActive(DTO.LABURNUM.COM.EventTypeModel model)
        {
            model.EventTypeId.TryValidate();
            IQueryable <API.LABURNUM.COM.EventType> iQuery           = this._laburnum.EventTypes.Where(x => x.EventTypeId == model.EventTypeId && x.IsActive == true);
            List <API.LABURNUM.COM.EventType>       dbEventTypeTypes = iQuery.ToList();

            if (dbEventTypeTypes.Count == 0)
            {
                throw new Exception(API.LABURNUM.COM.Component.Constants.ERRORMESSAGES.NO_RECORD_FOUND);
            }
            if (dbEventTypeTypes.Count > 1)
            {
                throw new Exception(API.LABURNUM.COM.Component.Constants.ERRORMESSAGES.MORE_THAN_ONE_RECORDFOUND);
            }
            dbEventTypeTypes[0].IsActive    = model.IsActive;
            dbEventTypeTypes[0].LastUpdated = new Component.Utility().GetISTDateTime();
            this._laburnum.SaveChanges();
        }
Exemplo n.º 8
0
 public long Add(DTO.LABURNUM.COM.EventTypeModel model)
 {
     return(AddValidation(model));
 }
Exemplo n.º 9
0
 private long AddValidation(DTO.LABURNUM.COM.EventTypeModel model)
 {
     model.Text.TryValidate();
     return(AddEventType(model));
 }