public List <ModelView.UserCardModel> GetCardList(IConnectionHandler connectionHandler, User user, ConfigurationContent configcontent, Homa homa, List <BoothOfficer> boothOfficers) { var list = new List <ModelView.UserCardModel>(); var fileFacade = FileManagerComponent.Instance.FileFacade; foreach (var boothOfficer in boothOfficers) { var booth = boothOfficer.Booth; if (booth == null) { continue; } var userKartModel = new ModelView.UserCardModel(); if (configcontent != null && configcontent.LogoId.HasValue && configcontent.Logo != null) { userKartModel.CongressLogo = configcontent.Logo.Content; } var enterpriseNode = boothOfficer.EnterpriseNode; if (enterpriseNode != null) { if (enterpriseNode.PictureId.HasValue) { var file = fileFacade.Get(enterpriseNode.PictureId); if (file != null) { userKartModel.UserImage = file.Content; } } var realEnterpriseNode = enterpriseNode.RealEnterpriseNode; if (realEnterpriseNode != null) { userKartModel.FirstName = realEnterpriseNode.FirstName; userKartModel.LastName = realEnterpriseNode.LastName; userKartModel.NationalCode = realEnterpriseNode.NationalCode; } } userKartModel.Id = user.Id.ToString(); userKartModel.CongressTitle = homa.CongressTitle; userKartModel.UseName = enterpriseNode.Title(); userKartModel.Type = string.Format(Resources.Congress.BoothOfficerCard, booth.Code); userKartModel.CardType = Enums.CardType.BoothOfficerCard; userKartModel.CardId = Enums.CardType.BoothOfficerCard + "-" + user.Id; list.Add(userKartModel); } return(list); }
public ModelView.UserCardModel GetBoothOfficerCard(Guid Id, Guid boothId, Guid userId) { try { var userBo = new UserBO(); var boothOfficerBo = new BoothOfficerBO(); var user = userBo.Get(this.ConnectionHandler, userId); var homa = new HomaBO().Get(this.ConnectionHandler, user.CongressId); var configcontent = new ConfigurationContentBO().Get(this.ConnectionHandler, user.CongressId, homa.Configuration.CardLanguageId); var list = new ModelView.UserCardModel(); var userBooth = new UserBoothBO().Get(this.ConnectionHandler, userId, boothId); if (userBooth.Status == (byte)Enums.RezervState.PayConfirm || userBooth.Status == (byte)Enums.RezervState.Finalconfirm) { var boothOfficers = boothOfficerBo.Get(this.ConnectionHandler, Id, boothId, userId); if (boothOfficers == null) { return(list); } list = boothOfficerBo.GetCardList(this.ConnectionHandler, user, configcontent, homa, new List <BoothOfficer>() { boothOfficers }).FirstOrDefault(); } return(list); } catch (KnownException ex) { Log.Save(ex.Message, LogType.ApplicationError, ex.Source, ex.StackTrace); throw new KnownException(ex.Message, ex); } catch (Exception ex) { Log.Save(ex.Message, LogType.ApplicationError, ex.Source, ex.StackTrace); throw new KnownException(ex.Message, ex); } }
public ModelView.UserCardModel SearchChipFoodReport(Guid chipfoodId, Guid userId) { try { var userCardModels = new ModelView.UserCardModel(); var userBo = new UserBO(); var user = userBo.Get(this.ConnectionHandler, userId); var config = new ConfigurationBO().Get(this.ConnectionHandler, user.CongressId); var configcontent = new ConfigurationContentBO().Get(this.ConnectionHandler, user.CongressId, config.CardLanguageId); var homa = new HomaBO().Get(this.ConnectionHandler, user.CongressId); var chipsFoodUserBo = new ChipsFoodUserBO(); var chipsFoodUsers = chipsFoodUserBo.Get(this.ConnectionHandler, chipfoodId, user.Id); var chipsFoodBo = new ChipsFoodBO(); if (chipsFoodUsers != null) { var chipsFood = chipsFoodBo.Get(this.ConnectionHandler, chipsFoodUsers.ChipsFoodId); var cardModels = userBo.GetChipFootUser(this.ConnectionHandler, user, configcontent, homa, new List <ChipsFood> { chipsFood }); if (cardModels.Count > 0) { userCardModels = cardModels.FirstOrDefault(); } } return(userCardModels); } catch (KnownException ex) { Log.Save(ex.Message, LogType.ApplicationError, ex.Source, ex.StackTrace); throw new KnownException(ex.Message, ex); } catch (Exception ex) { Log.Save(ex.Message, LogType.ApplicationError, ex.Source, ex.StackTrace); throw new KnownException(ex.Message, ex); } }