Beispiel #1
0
 public void Remove(LocationRemoveCommand command)
 {
     Status         = EnumDefine.CommonStatusEnum.Deleted;
     UpdatedDateUtc = command.CreatedDateUtc;
     UpdatedUid     = command.UpdatedUid;
     UpdatedDateUtc = command.UpdatedDateUtc;
     //AddEvent(this.ToRemoveEvent());
 }
 public async Task ChangeStatus(string id, EnumDefine.CommonStatusEnum status, string userId, DateTime updatedDate)
 {
     await WithConnection(async (connection) =>
     {
         DynamicParameters parameters = new DynamicParameters();
         parameters.Add("@Id", id, DbType.String);
         parameters.Add("@Status", status.AsEnumToInt(), DbType.Int16);
         parameters.Add("@UpdatedDateUtc", updatedDate, DbType.DateTime);
         parameters.Add("@UpdatedUid", userId, DbType.String);
         return(await connection.ExecuteAsync(ProcName.BannerItem_ChangeStatus, parameters, commandType: CommandType.StoredProcedure));
     });
 }
Beispiel #3
0
        public void ChangeStatus(EnumDefine.CommonStatusEnum status, DateTime updatedDate, string uid)
        {
            Status         = status;
            UpdatedDateUtc = updatedDate;
            UpdatedUid     = uid;

            if (status == CommonStatusEnum.Deleted)
            {
                AddEvent(ToRemoveCacheEvent());
            }
            else
            {
                AddEvent(ToAddOrChangeCacheEvent());
            }
        }
Beispiel #4
0
 public void Init(ProvinceUpdateCommand command)
 {
     Id             = command.Id;
     Prefix         = "";
     ProvinceName   = command.ProvinceName;
     ProvinceNameEN = command.ProvinceNameEN;
     Status         = EnumDefine.CommonStatusEnum.Active;
     ShortName      = "";
     Priority       = 1;
     Latitude       = command.Latitude;
     Longitude      = command.Longitude;
     RegionId       = 1;
     UpdatedDateUtc = command.UpdatedDateUtc;
     CreatedDateUtc = new DateTime(2018, 03, 14, 11, 46, 02);
     CreatedUid     = "";
     UpdatedUid     = command.UpdatedUid;
 }
Beispiel #5
0
 public async Task <RProductGroup[]> Search(string name, EnumDefine.CommonStatusEnum status, RefSqlPaging sqlPaging)
 {
     return(await WithConnection(async (connection) =>
     {
         DynamicParameters parameters = new DynamicParameters();
         parameters.Add("@Name", name, DbType.String);
         parameters.Add("@Status", status.AsEnumToInt(), DbType.Int32);
         parameters.Add("@DeleteStatus", EnumDefine.CommonStatusEnum.Deleted.AsEnumToInt(), DbType.Int32);
         parameters.Add("@OFFSET", sqlPaging.OffSet, DbType.Int32);
         parameters.Add("@FETCH", sqlPaging.PageSize, DbType.Int32);
         var data = await connection.QueryAsync <RProductGroup>(ProcName.ProductGroup_Search, parameters, commandType: CommandType.StoredProcedure);
         var dataReturn = data.ToArray();
         if (dataReturn.Length > 0)
         {
             sqlPaging.TotalRow = dataReturn[0].TotalRow;
         }
         return dataReturn;
     }));
 }
Beispiel #6
0
        public async Task <RTemplate[]> Search(string code, string templateName, EnumDefine.CommonStatusEnum status, RefSqlPaging paging)
        {
            return(await WithConnection(async (connection) =>
            {
                DynamicParameters parameters = new DynamicParameters();
                parameters.Add("@Code", string.IsNullOrEmpty(code) ? string.Empty : code, DbType.String);
                parameters.Add("@TemplateName", string.IsNullOrEmpty(templateName) ? string.Empty : templateName, DbType.String);
                parameters.Add("@Status", status.AsEnumToInt(), DbType.Int16);
                parameters.Add("@OFFSET", paging.OffSet, DbType.Int32);
                parameters.Add("@FETCH", paging.PageSize, DbType.Int32);
                parameters.Add("@DeletedStatus", EnumDefine.CommonStatusEnum.Deleted.AsEnumToInt(), DbType.Int32);
                var data = await connection.QueryAsync <RTemplate>(ProcName.Template_Search, parameters, commandType: CommandType.StoredProcedure);

                var dataReturn = data.ToArray();
                if (dataReturn.Length > 0)
                {
                    paging.TotalRow = dataReturn[0].TotalRow;
                }
                return dataReturn;
            }));
        }
Beispiel #7
0
 public async Task ChangeStreetStatus(string id, EnumDefine.CommonStatusEnum status, string updatedUid, DateTime updatedDate)
 {
     await _locationRepository.ChangeStreetStatus(id, status, updatedUid, updatedDate);
 }
 public async Task ChangeBannerItemStatus(string id, EnumDefine.CommonStatusEnum status, string userId, DateTime updatedDate)
 {
     await _bannerItemRepository.ChangeStatus(id, status, userId, updatedDate);
 }
 public async Task <RBannerItem[]> SearchBannerItem(string id, string bannerItemName, string bannerId, EnumDefine.CommonStatusEnum status, bool isDefault, DateTimeRange startDate, DateTimeRange endDate, RefSqlPaging paging)
 {
     return(await _bannerItemRepository.Search(id, bannerItemName, bannerId, status, isDefault, startDate, endDate, paging));
 }
 public async Task <RBanner[]> SearchBanner(string id, string bannerName, EnumDefine.CommonStatusEnum bannerStatus, RefSqlPaging paging)
 {
     return(await _bannerRepository.Search(id, bannerName, bannerStatus, paging));
 }
 public async Task <RProductGroup[]> Search(string name, EnumDefine.CommonStatusEnum status, RefSqlPaging sqlPaging)
 {
     return(await _productGroupRepository.Search(name, status, sqlPaging));
 }
        public async Task <RBannerItem[]> Search(string id, string bannerItemName, string bannerId, EnumDefine.CommonStatusEnum status, bool isDefault, DateTimeRange startDate, DateTimeRange endDate, RefSqlPaging paging)
        {
            return(await WithConnection(async (connection) =>
            {
                DynamicParameters parameters = new DynamicParameters();
                parameters.Add("@Id", string.IsNullOrEmpty(id) ? string.Empty : id, DbType.String);
                parameters.Add("@BannerItemName", string.IsNullOrEmpty(bannerItemName) ? string.Empty : bannerItemName, DbType.String);
                parameters.Add("@BannerId", string.IsNullOrEmpty(bannerId) ? string.Empty : bannerId, DbType.String);
                parameters.Add("@Status", status.AsEnumToInt(), DbType.Int16);
                parameters.Add("@IsDefault", isDefault, DbType.Boolean);
                parameters.Add("@StartDateUtcFrom", startDate.FromDate, DbType.DateTime);
                parameters.Add("@StartDateUtcTo", startDate.ToDate, DbType.DateTime);
                parameters.Add("@EndDateUtcFrom", endDate.FromDate, DbType.DateTime);
                parameters.Add("@EndDateUtcTo", endDate.ToDate, DbType.DateTime);
                parameters.Add("@OFFSET", paging.OffSet, DbType.Int32);
                parameters.Add("@FETCH", paging.PageSize, DbType.Int32);
                parameters.Add("@DeletedStatus", EnumDefine.CommonStatusEnum.Deleted.AsEnumToInt(), DbType.Int32);
                var data = await connection.QueryAsync <RBannerItem>(ProcName.BannerItem_Search, parameters, commandType: CommandType.StoredProcedure);

                var dataReturn = data.ToArray();
                if (dataReturn.Length > 0)
                {
                    paging.TotalRow = dataReturn[0].TotalRow;
                }
                return dataReturn;
            }));
        }
 public async Task ChangeTemplateConfigStatus(string id, string userId, DateTime changeDate, EnumDefine.CommonStatusEnum status)
 {
     await _templateConfigRepository.ChangeStatus(id, userId, changeDate, status);
 }
 public async Task <RTemplateConfig[]> SearchTemplateConfig(string id, string templateId, EnumDefine.TemplateConfigComponentTypeEnum componentType, EnumDefine.CommonStatusEnum status, RefSqlPaging paging)
 {
     return(await _templateConfigRepository.Search(id, templateId, componentType, status, paging));
 }
 public async Task <RTemplate[]> Search(string code, string templateName, EnumDefine.CommonStatusEnum status, RefSqlPaging paging)
 {
     return(await _templateRepository.Search(code, templateName, status, paging));
 }