Exemplo n.º 1
0
 public ActionResult Index()
 {
     try
     {
         StoreModelView model = new StoreModelView();
         model.StoreID = CurrentUser.StoreId;
         return(View(model));
     }
     catch (Exception ex)
     {
         _logger.Error("StoreInformations_Index: " + ex);
         return(new HttpStatusCodeResult(400, ex.Message));
     }
 }
Exemplo n.º 2
0
 public ActionResult Search(StoreModelView model)
 {
     try
     {
         List <SelectListItem> lstStore = ViewBag.ListStore;
         if (lstStore.Count == 1)
         {
             model.StoreID = lstStore[0].Value;
         }
         StoreGroupByCompany groupComp = new StoreGroupByCompany();
         var data = _factory.GetListStores(model.StoreID, null, CurrentUser.ListOrganizationId);
         var lstdataGroupByCompany = data.GroupBy(item => new { CompanyId = item.CompanyID, CompanyName = item.CompanyName }).ToList();
         lstdataGroupByCompany.ForEach(comp => {
             groupComp             = new StoreGroupByCompany();
             groupComp.CompanyName = comp.Key.CompanyName;
             groupComp.CompanyId   = comp.Key.CompanyId;
             var lsStore           = comp.ToList();
             lsStore.ForEach(item => {
                 groupComp.List_Store.Add(new SStoreModels()
                 {
                     OrganizationName = item.OrganizationName,
                     Name             = item.Name,
                     IsActive         = item.IsActive,
                     CompanyName      = item.CompanyName,
                     IndustryName     = item.IndustryName,
                     Street           = item.Street,
                     Phone            = item.Phone,
                     ImageURL         = item.ImageURL,
                     ID     = item.ID,
                     Status = item.Status,
                 });
             });
             groupComp.List_Store = groupComp.List_Store.OrderBy(z => z.Name).ToList();
             model.List_Store_Group.Add(groupComp);
         });
     }
     catch (Exception ex)
     {
         _logger.Error("StoreInformations_Search: " + ex);
         return(new HttpStatusCodeResult(400, ex.Message));
     }
     return(PartialView("_ListData", model));
 }