public static List <Exhibition> SelectByParentID(int parentID)
    {
        List <Exhibition> channelData = new List <Exhibition>();
        List <int>        idList      = new List <int>();

        //查询数据
        Exhibition value    = new Exhibition();
        Exhibition conditon = new Exhibition();

        if (parentID > 0)
        {
            conditon.Path = "%~" + parentID + "~%";
            conditon.AddAttach("Path", "like");
        }
        List <Exhibition> oldTypeData = TableOperate <Exhibition> .Select(value, conditon, 0, " order by ParentID, Depth, ID DESC ");

        for (int i = 0; i < oldTypeData.Count; i++)
        {
            Exhibition typeObj = oldTypeData[i];
            if (typeObj.Depth == 0) //深度为0,直接添加
            {
                channelData.Insert(0, typeObj);
                idList.Insert(0, typeObj.ID);
            }
            else
            {
                int parentIndex = idList.IndexOf(typeObj.ParentID); //查找上及目录所在位置!
                channelData.Insert(parentIndex + 1, typeObj);
                idList.Insert(parentIndex + 1, typeObj.ID);         //将数据插入上级目录之后
            }
        }
        return(channelData);
    }
Exemple #2
0
        public async Task <IActionResult> PutExhibition(int id, Exhibition exhibition)
        {
            if (id != exhibition.midex)
            {
                return(BadRequest());
            }

            _context.Entry(exhibition).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ExhibitionExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Exemple #3
0
        public CardItemExhibition(MainMenuxaml win, Exhibition exhibition)
        {
            this.win = win;
            InitializeComponent();
            Uri urislide1 = new Uri(exhibition.Image_Main, UriKind.RelativeOrAbsolute);

            this.MainImageExhibition.Source = BitmapFrame.Create(urislide1);
            this.EventNameExhibition.Text   = exhibition.Name ?? "";

            if (exhibition.Address != null)
            {
                if (!exhibition.Address.Equals(""))
                {
                    if (exhibition.Address[0] == ' ')
                    {
                        exhibition.Address = exhibition.Address.Remove(0, 1);
                    }
                }
                this.PlaceExhibition.Text = exhibition.Address + "\n";
            }
            if (exhibition.Event_Date != null && !exhibition.Event_Date.Equals(""))
            {
                this.TimetableExhibition.Text = exhibition.Event_Date;
            }
            this.exhibition = exhibition;
        }
        public Exhibition AddExhibition(Exhibition exhibition)
        {
            _dbcontext.Exhibitions.Add(exhibition);
            _dbcontext.SaveChanges();

            return(exhibition);
        }
Exemple #5
0
        public ActionResult Create([Bind(Include = "id,author,description,showimage,coverimage,typeid,resourceaddress,name")] Exhibition exhibition,
                                   HttpPostedFileBase file, HttpPostedFileBase picture)
        {
            //var filePath = Server.MapPath(path);
            if (customService.SaveFile(file))
            {
                exhibition.resourceaddress = file.FileName;
            }
            if (picture != null)
            {
                string ExtName = Path.GetExtension(picture.FileName).ToLower();
                if (ExtName != ".jpg" && ExtName != ".jpeg" && ExtName != ".png" && ExtName != ".gif")
                {
                    return(Content("图片格式不正确,只允许上传jpg,png,gif!" +
                                   "<a href=#' onClick='javascript :history.back(-1);'>返回</a>"));
                }
                customService.SaveFile(picture);
                exhibition.showimage = picture.FileName;
            }

            if (ModelState.IsValid)
            {
                exhibitionService.AddExhibition(exhibition);
                return(RedirectToAction("Index"));
            }

            return(View(exhibition));
        }
 public bool DeleteExhibiton(Exhibition exhibiton)
 {
     using (var uow = new ShipwayUnitOfWork())
     {
         return(uow.ExhibitionRepositoty.Delete(exhibiton));
     }
 }
        public void Handle_OnScanResult(Result result)
        {
            IsScanning = false;
            SQLiteDB   db = new SQLiteDB();
            Exhibition ex = new Exhibition();

            if (string.IsNullOrWhiteSpace(result.Text))
            {
                return;
            }
            Device.BeginInvokeOnMainThread(async() =>
            {
                //ex = App.Database.GetExhibitionsAsync(result.Text).Result;
                ex = db.GetItemAsyncExhibitionQR(result.Text).Result;
                Console.WriteLine("EX: " + ex);
                //await Navigation.PushAsync(new NavigationPage(new QRContentPage(result.Text)));
                if (Device.RuntimePlatform == Device.Android)
                {
                    await Navigation.PushModalAsync(new NavigationPage(new VideoPage(ex)));
                }
                else
                {
                    await Navigation.PushAsync(new VideoPage(ex));
                }
            });
        }
Exemple #8
0
        public IHttpActionResult PutExhibition(int id, Exhibition exhibition)
        {
            User user = db.Users.Where(u => u.Username == User.Identity.Name).FirstOrDefault();

            if (!ModelState.IsValid || user.RoleId != 2)
            {
                return(BadRequest(ModelState));
            }

            if (id != exhibition.ExhibitionId)
            {
                return(BadRequest());
            }

            db.Entry(exhibition).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ExhibitionExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public ActionResult Edit([Bind(Include = "ExhibitionId,UserId,Title,ImagePath,Location,Address,Statement,StartDate,EndDate")] Exhibition exhibition)
        {
            if (ModelState.IsValid)
            {
                string oldpicpath = Request.Form["OldImagePath"];
                TryUpdateModel(exhibition);
                exhibition.Modified = DateTime.Now;

                db.Entry(exhibition).State = EntityState.Modified;
                if (Request.Files["ImagePath"].ContentLength != 0)
                {
                    string imagePath = Server.MapPath(Global.ExhibitionImages + string.Format("Exhibition_{0}_{1}.jpg", exhibition.ExhibitionId, DateTime.Now.ToString("ddMMyyss")));
                    exhibition.ImagePath = ImageHelper.UploadImage(Request.Files["ImagePath"], Global.ExhibitionImages, imagePath, false);
                }
                else
                {
                    exhibition.ImagePath = oldpicpath;
                }

                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(exhibition));
        }
        private void ParseExhibition(string json)
        {
            if (json == null)
            {
                Debug.LogError("Couldn't load exhibition from backend");
                Debug.Log("Loading placeholder instead");
                var jtf = Resources.Load <TextAsset>("Configs/placeholder-exhibition");
                json = jtf.text;
            }

            Debug.Log(json);
            Exhibition ex = JsonUtility.FromJson <Exhibition>(json);

            Debug.Log(json);
            Debug.Log(ex);
            Debug.Log(_buildingManager);
            // TODO create lobby

            _exhibitionManager = new ExhibitionManager(ex);
            _exhibitionManager.GenerateExhibition();
            //_buildingManager.Create(ex);


            //_buildingManager.BuildRoom(ex.rooms[0]);

/*
 *    if (Settings.PlaygroundEnabled)
 *    {*/
            /*
             * ex.rooms[0].position = new Vector3(15,0,0);
             * ObjectFactory.BuildRoom(ex.rooms[0]);
             */
            //    }
        }
        public async Task <Exhibition> AddAsync(Exhibition Exhibition)
        {
            context.Exhibition.Add(Exhibition);
            await context.SaveChangesAsync();

            return(Exhibition);
        }
        public ExhibitionDto Create(ExhibitionDto dto)
        {
            if (string.IsNullOrEmpty(dto.Name))
            {
                throw new ArgumentNullException("Name");
            }

            Exhibition exhibition = new Exhibition()
            {
                Name             = dto.Name,
                Description      = dto.Description,
                StartDate        = dto.StartDate,
                FinishDate       = dto.FinishDate,
                Organiser        = dto.Organiser,
                Price_Adult      = dto.Price_Adult,
                Price_Child      = dto.Price_Child,
                Price_Concession = dto.Price_Concession,
                CreatedDate      = DateTime.UtcNow,
                ModifiedDate     = DateTime.UtcNow,
                IsDeleted        = false
            };

            if (dto.Image != null)
            {
                exhibition.Image = dto.Image;
            }

            Db.Exhibitions.Add(exhibition);

            Db.SaveChanges();

            return(Mapper.Map <ExhibitionDto>(exhibition));
        }
Exemple #13
0
        public bool setExhibition(DataSetMuseum dataSet)
        {
            bool       result     = false;
            Connection connection = new Connection();

            connection.Open();
            try
            {
                Transaction transaction = connection.BeginTransaction();
                try
                {
                    exhibition = new Exhibition();
                    exhibition.Save(dataSet, connection, transaction);
                    transaction.Commit();
                    result = true;
                }
                catch (Exception ex)
                {
                    ShowError(ex.ToString());
                    transaction.Rollback();
                    result = false;
                }
            }
            finally
            {
                connection.Close();
            }
            return(result);
        }
Exemple #14
0
        public DataSetMuseum getExhibition()
        {
            DataSetMuseum result     = new DataSetMuseum();
            Connection    connection = new Connection();

            connection.Open();
            try
            {
                Transaction transaction = connection.BeginTransaction();
                try
                {
                    exhibition = new Exhibition();
                    exhibition.Read(result, connection, transaction);
                    transaction.Commit();
                }
                catch (Exception ex)
                {
                    ShowError(ex.ToString());
                    transaction.Rollback();
                    result = null;
                }
            }
            finally
            {
                connection.Close();
            }
            return(result);
        }
        public async Task <Exhibition> UpdateAsync(Exhibition Exhibition)
        {
            context.Update(Exhibition);
            await context.SaveChangesAsync();

            return(Exhibition);
        }
        public Exhibition UpdateExhition(Exhibition exhibition)
        {
            _dbcontext.Exhibitions.Update(exhibition);
            _dbcontext.SaveChanges();

            return(exhibition);
        }
        // PUT api/Exhibition/5
        public HttpResponseMessage PutExhibition(int id, Exhibition exhibition)
        {
            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }

            if (id != exhibition.Id)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
            }

            db.Entry(exhibition).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.NotFound, ex));
            }

            return(Request.CreateResponse(HttpStatusCode.OK));
        }
Exemple #18
0
        public async Task <IActionResult> Edit(int id, [Bind("Name,Price,Description,Thumbnail,Id")] Exhibition exhibition)
        {
            if (id != exhibition.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(exhibition);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ExhibitionExists(exhibition.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(exhibition));
        }
Exemple #19
0
        public async Task <IActionResult> Edit(int id, [Bind("IdExhibition,ExhibitionName,MuseumId")] Exhibition exhibition)
        {
            if (id != exhibition.IdExhibition)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(exhibition);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ExhibitionExists(exhibition.IdExhibition))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["MuseumId"] = new SelectList(_context.Set <Museum>(), "IdMuseum", "MuseumName", exhibition.MuseumId);
            return(View(exhibition));
        }
    public static Exhibition GetChannelByID(int id)
    {
        Exhibition conditon = new Exhibition();

        conditon.ID = id;
        return(TableOperate <Exhibition> .GetRowData(conditon));
    }
 public void InsertExhibiton(Exhibition exhibiton)
 {
     using (var uow = new ShipwayUnitOfWork())
     {
         uow.ExhibitionRepositoty.Add(exhibiton);
     }
 }
Exemple #22
0
 public ExhibitsViewModel()
 {
     Exhibition = new Exhibition
     {
         Exhibition_Name = "name",
     };
 }
 public Exhibition UpdateExhibition(Exhibition exhibition)
 {
     using (var uow = new ShipwayUnitOfWork())
     {
         return(uow.ExhibitionRepositoty.Update(exhibition));
     }
 }
 private void GeneratePaintings(Document document, Exhibition exhibition)
 {
     foreach (Painting painting in exhibition.Paintings)
     {
         GeneratePainting(document, painting);
     }
 }
    /// <summary>
    /// 添加栏目
    /// </summary>
    public static int Insert(Exhibition channel)
    {
        if (channel.ParentID == 0)
        {
            channel.Depth    = 0;
            channel.ParentID = 0;
            channel.Path     = "0~";
            channel.NamePath = "所有栏目~";
            channel.AddInsert("RootID", "IDENT_CURRENT('Exhibition')");
        }
        else
        {
            Exhibition condition = new Exhibition();
            condition.ID = channel.ParentID;
            Exhibition parentChannel = TableOperate <Exhibition> .GetRowData(condition);

            string path     = Convert.ToString(parentChannel.Path) + channel.ParentID + "~";
            string namePath = Convert.ToString(parentChannel.NamePath) + Convert.ToString(parentChannel.Name) + "~";
            channel.Depth    = parentChannel.Depth + 1;
            channel.Path     = path;
            channel.RootID   = parentChannel.RootID;
            channel.NamePath = namePath;
        }
        return(TableOperate <Exhibition> .InsertReturnID(channel));
    }
Exemple #26
0
    protected void Page_Load(object sender, EventArgs e)
    {
        m_ExhibitionList = ExhibitionProvider.SelectAll();
        string action = GetstringKey("action");

        if (action != "save")
        {
            if (!string.IsNullOrEmpty(this.Request["iD"]))
            {
                int        _iD       = Convert.ToInt32(this.Request["iD"]);
                Exhibition condition = new Exhibition();
                condition.ID = _iD;
                news         = TableOperate <Exhibition> .GetRowData(condition);

                m_nowChild = Convert.ToString(news.Child).ToLower();
                iD.Value   = Convert.ToString(news.ID);
            }
            DataBind();
        }
        else
        {
            Result     result         = new Result();
            string     logbrief       = "";
            Exhibition newChannelNews = new Exhibition();
            newChannelNews.ID = 0;
            newChannelNews.AutoForm(this.Page);
            string title = newChannelNews.Name;
            int    _iD;
            if (!string.IsNullOrEmpty(this.Request["iD"]))
            {
                _iD = Convert.ToInt32(this.Request["iD"]);
                ExhibitionProvider.Update(newChannelNews);
                result.msg = "编辑成功,等待返回列表";
                logbrief   = "管理员:【" + AdminMethod.AdminFullName + "】在" + DateTime.Now.GetDateTimeFormats('f')[0].ToString() + "编辑了为【" + title + "】的展厅架构";
            }
            else
            {
                newChannelNews.AddTime = DateTime.Now;
                newChannelNews.AddID   = AdminMethod.AdminID;
                _iD        = ExhibitionProvider.Insert(newChannelNews);
                result.msg = "添加成功,等待返回列表";
                logbrief   = "管理员:【" + AdminMethod.AdminFullName + "】在" + DateTime.Now.GetDateTimeFormats('f')[0].ToString() + "添加了为【" + title + "】的展厅架构";
            }

            if (_iD > 0)
            {
                result.isOk = true;
                Lognet.AddLogin(logbrief);
            }
            else
            {
                result.msg = "操作失败";
            }
            Response.ContentType = "text/json";
            Response.Write(new JavaScriptSerializer().Serialize(result));
            Response.End();
        }
        DataBind();
    }
 public IActionResult DeleteExhibitionByeid([FromBody] Exhibition exhibition)
 {
     if (MuseumSystem.DeleteExhibitionByEid(exhibition))
     {
         return(Json(new { code = 0, msg = "删除成功" }));
     }
     return(Json(new { code = -1, msg = "删除失败" }));
 }
 public ActionResult SearchExhibition(Exhibition exhibition)
 {
     ViewBag.ListNoteRequired = noteRequiredProvider.GetAllNoteRequired();
     ViewBag.ListKindService  = kindServiceProvider.GetAllKindService();
     ViewBag.ExhibitionStatus = exhibitionStatusProvider.GetAllExhibitionStatus();
     ViewBag.ListExhibition   = exhibitionProvider.SearchExhibitionByStatus(exhibition.ExhibitionStatusId);
     return(View("Index"));
 }
        public ActionResult DeleteConfirmed(int id)
        {
            Exhibition exhibition = db.Exhibitions.Find(id);

            db.Exhibitions.Remove(exhibition);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #30
0
        public VideoPage(Exhibition ex)
        {
            InitializeComponent();

            BindingContext = viewModel = new ExhibitsViewModel(ex);
            VideoSource vid = VideoSource.FromResource(ex.Exhibition_Video);

            videoPlayer.Source = vid;
        }
        public void OnNewExhibition()
        {
            string exhibitionTemplate = Assembly.GetExecutingAssembly().Location + @"\..\" + Constants.EXHIBITION_TEMPLATE_FILE;
            if (File.Exists(exhibitionTemplate))
            {
                NewExhibition = (Exhibition)XmlSerializerUtil.LoadXml(typeof(Exhibition), exhibitionTemplate);
            }
            else
            {
                NewExhibition = new Exhibition();
            }

            NewExhibition.Description = ExhibitionDescription;
            NewExhibition.SetPropertyValue(Constants.SERVER_ID_KEY, SeverId);
            NewExhibition.SetPropertyValue(Constants.SERVER_IP_KEY, SeverIp);
            NewExhibition.SetPropertyValue(Constants.SERVER_PORT_KEY, SeverPort);

            TryClose();
        }
 protected void OnRunReferenceItemDialog(object sender, Reference.RunReferenceItemDlgEventArgs e)
 {
     ResponseType Result;
     switch (e.TableName)
     {
         case "nomenclature":
             Nomenclature ItemNomen = new Nomenclature();
             if(e.NewItem)
                 ItemNomen.NewItem = true;
             else
                 ItemNomen.Fill(e.ItemId);
             ItemNomen.Show();
             Result = (ResponseType)ItemNomen.Run();
             ItemNomen.Destroy();
             break;
         case "basis":
             Basis BasisEdit = new Basis();
             if(e.NewItem)
                 BasisEdit.NewItem = true;
             else
                 BasisEdit.Fill(e.ItemId);
             BasisEdit.Show();
             Result = (ResponseType)BasisEdit.Run();
             BasisEdit.Destroy();
             break;
         case "cubes":
             CubesDlg CubesEdit = new CubesDlg();
             if(e.NewItem)
                 CubesEdit.NewItem = true;
             else
             CubesEdit.Fill(e.ItemId);
             CubesEdit.Show();
             Result = (ResponseType)CubesEdit.Run();
             CubesEdit.Destroy();
             break;
         case "exhibition":
             Exhibition ExhibitionEdit = new Exhibition();
             if(!e.NewItem)
                 ExhibitionEdit.Fill(e.ItemId);
             ExhibitionEdit.Show();
             Result = (ResponseType)ExhibitionEdit.Run();
             ExhibitionEdit.Destroy();
             break;
         default:
             logger.Warn("Диалог для справочника {0} не найден.", e.TableName);
             Result = ResponseType.None;
             break;
     }
     e.Result = Result;
 }
    private void InitiateBasicSets()
    {
        exhibitionArray = new Exhibition[howManyExhibition];

        /*
        Cluster is how many exhibitions a visitor COULD go before go to
            boss exhibition.
        */
        int totalExhibitionsPerCluster =
            (exhibitionArray.Length/totalBoss);

        //Which exhibitions are the boss exhibition.
        List<int> bossExhibitionList = new List<int>();
        //Which exhibitions are the minimum exhibition for each clusters.
        List<int> minExhibitionList = new List<int>();

        for(int i = 0; i < exhibitionArray.Length; i ++){

            /*
            Initiate all exhibition.
            I can done this outside this loop, however, if I do Unity
                will give you null error at the first tick.
            */
            exhibitionArray[i] = new Exhibition();

            //Give dummy explanations.
            for(int j = 0; j < exhibitionArray[i].explanationArray.Length; j ++){

                exhibitionArray[i].explanationArray[j] = "Exhibition" + i + "Explanation" + j;

            }

            //Assign boss exhibitions to list.
            if(i%totalExhibitionsPerCluster == 0 && i != 0){
                exhibitionArray[i - 1].isBossExhibition = true;
                bossExhibitionList.Add(i - 1);
            }
            else if(i == exhibitionArray.Length - 1){
                exhibitionArray[i].isBossExhibition = true;
                bossExhibitionList.Add(i);
            }
            else{ exhibitionArray[i].isBossExhibition = false; }

            //Assign min exhibition to list.
            if(i%totalExhibitionsPerCluster == 0){
                exhibitionArray[i].isMinExhibition = true;
                minExhibitionList.Add(i);
            }
            else{ exhibitionArray[i].isMinExhibition = false; }

        }

        /*
        We have assigned the index of which exhibitions are boss and which exhibitions are min.
        Here we assigned those index to the array Exhibition.
        */
        for(int i = 0; i < exhibitionArray.Length; i ++){

            for(int j = 0; j < totalBoss; j ++){

                if(i >= minExhibitionList[j] && i <= bossExhibitionList[j]){

                    exhibitionArray[i].bossExhibition = bossExhibitionList[j];
                    exhibitionArray[i].minExhibition = minExhibitionList[j];

                }

            }

            /*
            Give target explanation to each exhibition.
            The easiest one to set is the minimum and boss exhibition.
            This thing is more complicated to understand than it seems.
            Basically I asked the array to input target exhibition based on the previous exhibition
                minExhibition and boss exhibition.
            Hence, the i - 1.
            If i is equal to target then change the target, because if you are at exhibition i you cannot
                ask your player/visitor to visit the same exhibition again.
            */
            bool reset = false; //If the number within a loop is reseted than continue from this number.
            int lastReset = 0; //Temporary variable to hold last position.
            int target = 0; //Target exhibition based on the calculation below.
            //These two variables is just for reset the reset boolean to false ahahahaa...
            int iNow = i;
            int iPrevious = 0;

            /*
            Loop through how many target exhibition from current exhibition.
            By target I mean the destined target exhibitions.
            */
            for(int j = 0; j < exhibitionArray[i].targetExhibitionArray.Length; j ++){

                /*
                If exhibition i is a boss exhibition.
                Which means the last exhibition from its cluster then assign only two target exhibitions.
                The first one is the min exhibition of exhibition i.
                The latter one is the next min exhibition from next cluster.
                */
                if(exhibitionArray[i].isBossExhibition){
                    if(i != exhibitionArray.Length - 1){
                        exhibitionArray[i].targetExhibitionArray[j] =
                            ((j + 1)%2 == 0)? i + 1 : exhibitionArray[i].minExhibition;
                    }
                    else if(i == exhibitionArray.Length - 1){
                        exhibitionArray[i].targetExhibitionArray[j] = 0;
                    }
                }

                //If min exhibition, then assign four next exhibition from this exhibition i.
                else if(exhibitionArray[i].isMinExhibition){
                    exhibitionArray[i].targetExhibitionArray[j] = i + (j + 1);
                }

                /*
                Things get trickier here.
                But the core things is still the same like I have mentioned above.
                If target is the same with target exhibition, then increase i with 1.
                If target is exceed with exhibition i bossExhibition, then reset i so that it is the same with
                    exhibition i minExhibition.
                */
                else{

                    /*
                    If exhibition change than reset back.
                    Hence, target can take the initial value.
                    */
                    iNow = i;
                    if(iNow != iPrevious){
                        reset = false;
                        iPrevious = iNow;
                    }
                    //Take the initial value of this exhiibiton from the last exhibition last index target.
                    if(!reset){
                        target =
                            exhibitionArray[i - 1].targetExhibitionArray[exhibitionArray[i].targetExhibitionArray.Length - 1] + (j + 1);
                    }
                    else if(reset){
                        target = lastReset + 1;
                        lastReset = target;
                        reset = true;
                    }

                    if(target > exhibitionArray[i].bossExhibition){
                        target = exhibitionArray[i].minExhibition;
                        lastReset = target;
                        reset = true;
                    }
                    if(target == i){
                        target = i + 1;
                        lastReset = target;
                        reset = true;
                    }
                    exhibitionArray[i].targetExhibitionArray[j] = target;

                }

            }

        }
    }
Exemple #34
0
		public static void DoCreateExhibition (Exhibition exhibition)
		{
			RealDoCreateExhibition (exhibition);
		}
Exemple #35
0
		private static async Task RealDoCreateExhibition (Exhibition exhibition)
		{
			string result = string.Empty;
			bool status = false;
			try {
				string url = string.Format ("{0}Data/CreateExhibition", Global.BaseUrl);
				Dictionary<string, string> d = new Dictionary<string, string> ();
				d.Add ("id", Helper.Encrypt (JsonConvert.SerializeObject (exhibition)));
				d.Add ("token", Global.ConnectedUser.Token.ToString ());
				HttpContent content = new FormUrlEncodedContent (d);
				var response = await theHttpClient.PostAsync (url, content);
				if (response.IsSuccessStatusCode) {
				}
				result = await response.Content.ReadAsStringAsync ();
				status = true;
			} catch (Exception err) {
				System.Diagnostics.Debug.WriteLine ("ERROR: " + err.Message);
			}
			JobDone (status, result);
		}
		private void CreateExhibition ()
		{
			Exhibition exhibition = new Exhibition ();
			exhibition.Title = entryName.Text.Trim ();
			exhibition.Description = entryDescription.Text.Trim ();
			exhibition.Builders = new List<Guid> ();
			exhibition.EndDate = dateStart.Date;
			exhibition.StartDate = dateStart.Date;
			exhibition.Flyer = flyerId;
			exhibition.IdBuilder = Global.ConnectedUser.IdBuilder;
			exhibition.IdCountry = Global.ConnectedUser.IdCountry;
			exhibition.Logo = logoId;
			uploadingLogo = false;
			uploadingFlyer = false;
			Tools.JobDone += Tools_JobDone;
			Tools.DoCreateExhibition (exhibition);
		}