Ejemplo n.º 1
0
 public BasketStore(Domain.Store store)
 {
     _store    = store;
     Id        = store.Id;
     Alias     = store.Alias;
     TypeAlias = store.TypeAlias;
 }
Ejemplo n.º 2
0
		public BasketStore(Domain.Store store)
		{
			_store = store;
			Id = store.Id;
			Alias = store.Alias;
			TypeAlias = store.TypeAlias;
		}
Ejemplo n.º 3
0
        public FormStore(Domain.Store entity)
        {
            InitializeComponent();
            LoadRegions();
            Entity = entity;

            lookUpRegions.Properties.PopupFormWidth = lookUpRegions.Width;
        }
Ejemplo n.º 4
0
 public static Storing.Repositories.Store Map(Domain.Store store)
 {
     return(new Storing.Repositories.Store()
     {
         StoreName = store.StoreName,
         Venue = store.Venue
     });
 }
Ejemplo n.º 5
0
 internal StoreListItem(Domain.Store user, IIdSerializer serializer)
 {
     Address      = new AddressItem(user.Address);
     Id           = serializer.Serialize("Query", nameof(Store), user.Id);
     Name         = user.Name;
     Picture      = user.Picture;
     HasProducers = user.ProducersCount > 0;
     Producers    = user.ProducersCount;
 }
Ejemplo n.º 6
0
        public async Task <StoreDto> Handle(CreateStoreCommand command, CancellationToken cancellationToken)
        {
            // address todo
            var store = new Domain.Store {
                Name = command.Name
            };
            await _storeRepository.AddAsync(store, cancellationToken);

            return(_mapper.Map <StoreDto>(store));
        }
Ejemplo n.º 7
0
 internal static Domain.Models.Store Map(Domain.Store store)
 {
     if (store == null)
     {
         return(null);
     }
     return(new Domain.Models.Store()
     {
         Id = store.Id,
         Name = store.Name,
         Location = store.Location.Id
     });
 }
Ejemplo n.º 8
0
        private void lookUpStores_EditValueChanged(object sender, EventArgs e)
        {
            if (lookUpStores.EditValue != null)
            {
                long         id    = Convert.ToInt64(lookUpStores.EditValue);
                Domain.Store store = _listStores.GetItemByID(id);

                if (store != null)
                {
                    SelectedStore = store;
                }
            }
        }
Ejemplo n.º 9
0
 public void AddStore(Domain.Store store)
 {
     if (pdb.Store.Any(e => e.StoreName == store.StoreName) || store.StoreName == null)
     {
         Console.WriteLine($"The username {store.StoreName} is already in use, please select another");
         return;
     }
     else
     {
         pdb.Store.Add(store);
     }
     pdb.SaveChanges();
 }
Ejemplo n.º 10
0
 public void ModifyStore(Domain.Store store)
 {
     if (pdb.Store.Any(e => e.StoreName == store.StoreName))
     {
         var sto = pdb.Store.FirstOrDefault(e => e.StoreName == store.StoreName);
         sto.Venue = store.Venue;
         pdb.Store.Update(sto);
         pdb.SaveChanges();
     }
     else
     {
         Console.WriteLine($"Account with username {store.StoreName} does not exists, please ensure credentials have been typed correctly");
     }
 }
        internal static void GenerateSeed(StoreDbContext deStoreDbContext)
        {
            if (deStoreDbContext.Stores.Any())
            {
                // do not seed, if the database has any data
                return;
            }

            var store = new Domain.Store
            {
                StoreId = Guid.NewGuid(),
                Name    = $"Store In Germany",
            };

            var address = new Address
            {
                AddressId     = Guid.NewGuid(),
                City          = "city",
                State         = "St",
                StreetAddress = "Str",
                ZipCode       = "911",
                IsMainAddress = true
            };

            store.Addresses.Add(address);

            for (var i = 10; i < 60; i++)
            {
                var product = new Product
                {
                    ProductId   = new Guid($"12345678-1234-1234-1234-1234567891{i}"),
                    Code        = $"11{i}",
                    Name        = $"Product{i}",
                    Description = "This is a test product!",
                    Price       = 3.14 * i,
                    ImageUrl    = $"Product{i - 9}.png", // image files from 1..50
                    Quantity    = 10,
                    Store       = store
                };

                store.Products.Add(product);
            }

            deStoreDbContext.Stores.Add(store);
        }
Ejemplo n.º 12
0
        private void SetStore(long storeid)
        {
            Domain.Store store = null;

            if (m_ListStores.TryGetValue(storeid, out store))
            {
                Domain.Region reg = null;
                if (m_listRegions.TryGetValue(store.RegionID, out reg))
                {
                    CountryId = reg.CountryID;
                    RegionId  = reg.ID;
                    StoreId   = storeid;
                    StoreWorldController sw = new StoreWorldController();
                    sw.LoadByStoreId(storeid);

                    storeWorldLookUpCtrl.EntityList = sw.GetListByStoreId(storeid);
                }
            }
        }
Ejemplo n.º 13
0
        public bool Commit()
        {
            if (IsValid())
            {
                if (_entityview.IsModified())
                {
                    _entityview.Commit();

                    if (Entity.IsNew)
                    {
                        Domain.Store st = ClientEnvironment.StoreService.Save(Entity);
                        Entity.ID = st.ID;
                    }
                    else
                    {
                        ClientEnvironment.StoreService.SaveOrUpdate(Entity);
                    }
                    _modified = true;
                    return(true);
                }
            }
            return(false);
        }
Ejemplo n.º 14
0
 public StoreView(Domain.Store store)
 {
     _store = store;
 }
 public async ValueTask AddAsync(Domain.Store store, CancellationToken cancellationToken)
 {
     await _stores.AddAsync(store, cancellationToken);
 }
 public void Update(Domain.Store store)
 {
     _stores.Update(store);
 }
 public void Remove(Domain.Store store)
 {
     _stores.Remove(store);
 }
Ejemplo n.º 18
0
        private void lookUpStores_EditValueChanged(object sender, EventArgs e)
        {
            if (lookUpStores.EditValue != null)
            {
                long id = Convert.ToInt64(lookUpStores.EditValue);
                Domain.Store store = _listStores.GetItemByID(id);

                if (store != null)
                {
                    SelectedStore = store;
                }
            }
        }
Ejemplo n.º 19
0
        public async Task <IResponse <Domain.Store> > SignUp(StoreSignUpModel model)
        {
            using var tb = _appUow.Database.BeginTransaction();
            var mobileNumber = long.Parse(model.MobileNumber);
            var user         = await _appUow.UserRepo.FirstOrDefaultAsync(conditions : x => x.MobileNumber == mobileNumber, null);

            var store = await _storeRepo.FirstOrDefaultAsync(conditions : x => x.Username == model.Username, null);

            if (store != null)
            {
                return new Response <Domain.Store> {
                           Message = ServiceMessage.DuplicateRecord
                }
            }
            ;
            var cdt = DateTime.Now;

            store = new Domain.Store
            {
                Username = model.Username,
                //FolowerCount = crawl.FolowerCount,
                //FolowingCount = crawl.FolowingCount,
                StoreType         = StoreType.Instagram,
                StoreStatus       = StoreStatus.Register,
                ProfilePictureUrl = null,            //crawl.ProfilePictureUrl,
                LastCrawlTime     = null,            //crawl.LastCrawlDate,
                FullName          = model.StoreName, //crawl.FullName,
                IsActive          = true,
                User = user ?? new User
                {
                    FullName           = model.FullName,
                    IsActive           = true,
                    MobileNumber       = mobileNumber,
                    LastLoginDateMi    = cdt,
                    LastLoginDateSh    = PersianDateTime.Now.ToString(PersianDateTimeFormat.Date),
                    InsertDateMi       = cdt,
                    Password           = HashGenerator.Hash(mobileNumber.ToString()),
                    NewPassword        = HashGenerator.Hash(mobileNumber.ToString()),
                    MustChangePassword = false,
                    UserStatus         = UserStatus.AddStore
                }
            };
            await _storeRepo.AddAsync(store);

            var saveStore = await _appUow.ElkSaveChangesAsync();

            if (!saveStore.IsSuccessful)
            {
                tb.Rollback();

                return(new Response <Domain.Store> {
                    Message = saveStore.Message
                });
            }
            if (user == null)
            {
                await _authUow.UserInRoleRepo.AddAsync(new UserInRole
                {
                    UserId = store.UserId,
                    RoleId = model.StoreRoleId ?? 0
                });

                var saveUserInRole = await _authUow.ElkSaveChangesAsync();

                if (!saveUserInRole.IsSuccessful)
                {
                    tb.Rollback();
                }
                else
                {
                    tb.Commit();
                }
                return(new Response <Domain.Store>
                {
                    IsSuccessful = saveUserInRole.IsSuccessful,
                    Result = store,
                    Message = saveStore.Message
                });
            }
            tb.Commit();
            return(new Response <Domain.Store>
            {
                IsSuccessful = true,
                Result = store
            });
        }
Ejemplo n.º 20
0
        private void Storeselected(object sender, EventArgs e)
        {
            ViceWorld viceWorld = null;
            ViceHWGR  viceHwgr  = null;
            ViceWGR   viceWgr   = null;

            m_wgrs.Clear();
            m_hwgrs.Clear();
            m_worlds.Clear();

            Dictionary <long, string> nameCapsule = new Dictionary <long, string>();
            List <Domain.WGR>         wgrs        = ClientEnvironment.WGRService.FindAll();
            List <Domain.HWGR>        hwgrs       = ClientEnvironment.HWGRService.FindAll();
            List <Domain.World>       worlds      = ClientEnvironment.WorldService.FindAll();

            List <long> dWgr = ClientEnvironment.HwgrToWgrService.GetHwgrToWgrFiltered(edBeginDate.DateTime)
                               .ConvertAll <long>(new Converter <HwgrToWgr, long>(delegate(HwgrToWgr w)
            {
                return(w.ID);
            }));
            List <long> dHwgr = ClientEnvironment.WorldToHWGRService.GetWorldToHwgrFiltered(edBeginDate.DateTime)
                                .ConvertAll <long>(new Converter <WorldToHwgr, long>(delegate(WorldToHwgr w)
            {
                return(w.ID);
            }));

            if (wgrs != null)
            {
                foreach (Domain.WGR var in wgrs)
                {
                    nameCapsule.Add(var.ID, var.Name);
                }
            }
            if (hwgrs != null)
            {
                foreach (Domain.HWGR var in hwgrs)
                {
                    nameCapsule.Add(var.ID, var.Name);
                }
            }
            if (worlds != null)
            {
                foreach (Domain.World var in worlds)
                {
                    nameCapsule.Add(var.ID, var.Name);
                }
            }
            string name = string.Empty;

            Domain.Store selected = edStore.EditValue as Domain.Store;

            if (selected != null)
            {
                System.Collections.IList storeStruct = ClientEnvironment.StoreService
                                                       .GetStoreStructure(selected.ID);

                if (storeStruct != null)
                {
                    foreach (Dao.QueryResult.StoreStructure str in storeStruct)
                    {
                        string s = String.Empty;
                        nameCapsule.TryGetValue(str.WorldID, out s);
                        str.WorldName = s;
                        s             = String.Empty;
                        nameCapsule.TryGetValue(str.HWGR_ID, out s);
                        str.HWGR_Name = s;
                        s             = String.Empty;
                        nameCapsule.TryGetValue(str.WGR_ID, out s);
                        str.WGR_Name = s;
                    }
                }
                StoreStructureItems items = new StoreStructureItems();
                items.ProcessStoreStructure(storeStruct);

                if (storeStruct != null)
                {
                    foreach (Dao.QueryResult.StoreStructure str in storeStruct)
                    {
                        if (!m_worlds.ContainsKey(str.Store_WorldID))
                        {
                            nameCapsule.TryGetValue(str.WorldID, out name);
                            viceWorld = new ViceWorld(name,
                                                      str.Store_WorldID,
                                                      str.WorldID);
                            m_worlds.Add(str.Store_WorldID, viceWorld);
                        }
                        if (!m_hwgrs.ContainsKey(str.World_HWGR_ID) &&
                            dHwgr.Contains(str.World_HWGR_ID) &&
                            viceWorld != null)
                        {
                            nameCapsule.TryGetValue(str.HWGR_ID, out name);
                            viceHwgr = new ViceHWGR(name,
                                                    str.World_HWGR_ID,
                                                    str.HWGR_BeginTime,
                                                    str.HWGR_EndTime,
                                                    str.HWGR_ID);
                            viceWorld.HWGRs.Add(viceHwgr);
                        }
                        nameCapsule.TryGetValue(str.WGR_ID, out name);
                        viceWgr = new ViceWGR(name,
                                              str.HWGR_WGR_ID,
                                              str.WGR_BeginTime,
                                              str.WGR_EndTime,
                                              str.WGR_ID);
                        if (!m_wgrs.ContainsKey(str.HWGR_WGR_ID) &&
                            dWgr.Contains(str.HWGR_WGR_ID) &&
                            viceHwgr != null)
                        {
                            m_wgrs.Add(str.HWGR_WGR_ID, viceWgr);
                            viceHwgr.WGRs.Add(viceWgr);
                        }
                    }
                }
                List <ViceWorld> t = new List <ViceWorld>();
                t.AddRange(m_worlds.Values);
                edWorld.Properties.DataSource = t;
                edWorld.Visible = true;
            }
        }