Exemplo n.º 1
0
        public object GetUsers(int take, int skip, int?countryId, int?accountTypeId, bool?isBlocked, DateTime?createDateFrom, DateTime?createDateTo)
        {
            try
            {
                var Result = db.SelectUsersByFilter(skip, take, accountTypeId, isBlocked, countryId, createDateFrom, createDateTo).ToList().Select(c => new
                {
                    c.Id,
                    CreateDate = DateService.GetDateTimeByCulture(c.CreateDate),
                    c.Email,
                    c.FullName,
                    c.Image,
                    c.IsBlocked,
                    Country = LanguageService.IsEn ? c.NameEn : c.NameAr,
                    c.PhoneNumber,
                    c.UserName
                }).ToList();

                if (Result.Count == 0)
                {
                    if (skip == 0)
                    {
                        return(new ResponseVM(RequestTypeEnumVM.Info, Token.NoResult));
                    }
                    return(new ResponseVM(RequestTypeEnumVM.Info, Token.NoResultMore));
                }
                return(new ResponseVM(RequestTypeEnumVM.Success, Token.Success, Result));
            }
            catch (Exception ex)
            {
                return(new ResponseVM(RequestTypeEnumVM.Error, Token.SomeErrorInServer, ex));
            }
        }
Exemplo n.º 2
0
 public object GetSampleEmailsSubscriptionInformation(SelectEmailsSubscriptionsByFilter_Result c)
 {
     return(new
     {
         Id = c.Id,
         Email = c.Email,
         CreatedDate = DateService.GetDateTimeByCulture(c.CreateDateTime),
     });
 }
Exemplo n.º 3
0
        public DateVM(DateTime endDate, DateTime startDate)
        {
            var Date = endDate - DateTime.Now;

            this.Days    = Date.Days;
            this.Hours   = Date.Hours;
            this.Minutes = Date.Minutes;
            this.Seconds = Date.Seconds;

            this.StartIn = DateService.GetDateTimeByCulture(startDate);
            this.EndIn   = DateService.GetDateTimeByCulture(endDate);
        }
        //Get TechnicalSupport
        public object GetTechnicalSupport(int take, int skip)
        {
            var TechnicalSupports = db.TechnicalSupports.OrderByDescending(c => c.Id).Skip(skip).Take(take).ToList();

            if (TechnicalSupports.Count == 0)
            {
                return new ResponseVM {
                           RequestType = RequestTypeEnumVM.Info, Message = Token.DataNotFound
                }
            }
            ;
            return(TechnicalSupports.Select(x => new
            {
                x.Id,
                Date = DateService.GetDateTimeByCulture(x.CreateDateTime),
                x.Message,
                x.Email,
                x.Subject,
                x.UserName
            }).ToList());
        }