Exemple #1
0
        public static bool EditGalleryGroup(int id, string name, string pageslug)
        {
            using (MainContext db = new MainContext())
            {
                try
                {
                    GalleryGroup record = db.GalleryGroup.Where(d => d.GalleryGroupId == id && d.Deleted == false).SingleOrDefault();
                    if (record != null)
                    {
                        record.GroupName = name;
                        //record.PageSlug = pageslug;
                        //   record.TimeUpdated = DateTime.Now;
                        db.SaveChanges();

                        //LogtrackManager logkeeper = new LogtrackManager();
                        //logkeeper.LogDate = DateTime.Now;
                        //logkeeper.LogProcess = EnumLogType.DokumanGrup.ToString();
                        //logkeeper.Message = LogMessages.GalleryGroupEdited;
                        //logkeeper.User = HttpContext.Current.User.Identity.Name;
                        //logkeeper.Data = record.GroupName;
                        //logkeeper.AddInfoLog(logger);

                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                catch (Exception ex)
                {
                    return(false);
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// Handles the MouseMove event of the Finance control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Input.MouseEventArgs"/> instance containing the event data.</param>
        private void Finance_MouseMove(object sender, MouseEventArgs e)
        {
            GalleryGroup ga = sender as GalleryGroup;
            GalleryItem  gi = (GalleryItem)ga.SelectionStartItem;

            gi.ToolTip = gi.Name.ToString();
        }
Exemple #3
0
        public static bool AddGalleryGroup(GalleryGroup record)
        {
            using (MainContext db = new MainContext())
            {
                try
                {
                    //record.TimeCreated = DateTime.Now;
                    record.Deleted   = false;
                    record.Online    = true;
                    record.SortOrder = 9999;
                    db.GalleryGroup.Add(record);
                    db.SaveChanges();

                    //LogtrackManager logkeeper = new LogtrackManager();
                    //logkeeper.LogDate = DateTime.Now;
                    //logkeeper.LogProcess = EnumLogType.DokumanGrup.ToString();
                    //logkeeper.Message = LogMessages.GalleryGroupAdded;
                    //logkeeper.User = HttpContext.Current.User.Identity.Name;
                    //logkeeper.Data = record.GroupName;
                    //logkeeper.AddInfoLog(logger);


                    return(true);
                }
                catch (Exception ex)
                {
                    return(false);
                }
            }
        }
		public ActionResult EditGallery(GalleryGroup model) {
			if (ModelState.IsValid) {
				GalleryHelper gh = new GalleryHelper(this.SiteID);
				GalleryGroup m = gh.GalleryGroupGetByID(model.GalleryID);
				if (m == null) {
					m = new GalleryGroup();
					m.SiteID = this.SiteID;
				}

				m.GalleryTitle = model.GalleryTitle;
				m.Save();

				return RedirectToAction("Index");
			} else {
				return View("EditGallery", model);
			}
		}
Exemple #5
0
        public ActionResult Index(string drplanguage, string txtname)
        {
            string lang = FillLanguagesList();

            if (ModelState.IsValid)
            {
                GalleryGroup model = new GalleryGroup();
                model.GroupName        = txtname;
                model.Language         = drplanguage;
                model.PageSlug         = Utility.SetPagePlug(txtname);
                ViewBag.ProcessMessage = GalleryManager.AddGalleryGroup(model);

                var grouplist = GalleryManager.GetGalleryGroupList(lang);

                return(View(grouplist));
            }
            return(View());
        }
Exemple #6
0
        /// <summary>
        /// Loads the images.
        /// </summary>
        /// <param name="resource">The resource.</param>
        /// <param name="ggroup">The ggroup.</param>
        private void LoadImages(ResourceDictionary resource, GalleryGroup ggroup)
        {
            ggroup.Items.Clear();

            foreach (string key in resource.Keys)
            {
                if (key.ToString() != "DeliveryReceipt/ReadReceipt")
                {
                    GalleryItem galleryitem = new GalleryItem();
                    galleryitem.Caption     = key;
                    galleryitem.Description = "";
                    Image img = new Image();
                    img.Margin          = new Thickness(5);
                    img.Source          = (DrawingImage)resource[key];
                    galleryitem.Content = img;
                    galleryitem.Name    = key;
                    galleryitem.ToolTip = key;
                    ggroup.Items.Add(galleryitem);
                }
            }
        }
Exemple #7
0
 public static GalleryGroup GetGalleryGroupById(int nid)
 {
     using (MainContext db = new MainContext())
     {
         try
         {
             GalleryGroup record = db.GalleryGroup.Where(d => d.GalleryGroupId == nid).SingleOrDefault();
             if (record != null)
             {
                 return(record);
             }
             else
             {
                 return(null);
             }
         }
         catch (Exception ex)
         {
             return(null);
         }
     }
 }
        public ActionResult EditGallery(GalleryGroup model)
        {
            if (ModelState.IsValid)
            {
                GalleryHelper gh = new GalleryHelper(this.SiteID);
                GalleryGroup  m  = gh.GalleryGroupGetByID(model.GalleryID);
                if (m == null)
                {
                    m        = new GalleryGroup();
                    m.SiteID = this.SiteID;
                }

                m.GalleryTitle = model.GalleryTitle;
                m.Save();

                return(RedirectToAction("Index"));
            }
            else
            {
                return(View("EditGallery", model));
            }
        }
Exemple #9
0
        /// <summary>
        /// Handles the MouseDoubleClick event of the galgrpPhotos control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Input.MouseButtonEventArgs"/> instance containing the event data.</param>
        private void galgrpPhotos_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            NavigationLeft.IsEnabled       = true;
            NavigationRight.IsEnabled      = true;
            mycanvas.Visibility            = Visibility.Visible;
            checkEnableMagnifier.IsChecked = false;
            GalleryGroup ga = sender as GalleryGroup;
            GalleryItem  gi = (GalleryItem)ga.SelectionStartItem;

            gallerygroup         = ga;
            index                = ga.SelectionStartIndex;
            mycanvas.Width       = window1.ActualWidth - 170;
            mycanvas.Height      = window1.ActualHeight - 200;
            canvas_border.Width  = mycanvas.Width + 10;
            canvas_border.Height = mycanvas.Height + 10;

            RectangleImage.Width  = mycanvas.Width - 330;
            RectangleImage.Height = mycanvas.Height - 120;

            RectangleImage.Source = this.Resources[gi.Name.ToString()] as ImageSource;
            if (gi.Name.ToString() == "TranscationFee")
            {
                canvastxt.Text = "TransactionFee";
            }
            else
            {
                canvastxt.Text = gi.Name.ToString();
            }
            canvasclose.Visibility = Visibility.Visible;
            rectheight             = RectangleImage.Height;
            rectwidth = RectangleImage.Width;

            sliderimageSize.Maximum = rectheight;

            sliderimageSize.Value = 185;
            RectangleImage.Height = sliderimageSize.Value;
            RectangleImage.Width  = sliderimageSize.Value;
        }
Exemple #10
0
 public static bool SortRecords(string[] idsList)
 {
     using (MainContext db = new MainContext())
     {
         try
         {
             int row = 0;
             foreach (string id in idsList)
             {
                 int          mid           = Convert.ToInt32(id);
                 GalleryGroup sortingrecord = db.GalleryGroup.SingleOrDefault(d => d.GalleryGroupId == mid);
                 sortingrecord.SortOrder = Convert.ToInt32(row);
                 db.SaveChanges();
                 row++;
             }
             return(true);
         }
         catch (Exception)
         {
             return(false);
         }
     }
 }
Exemple #11
0
        private ItemContainer CreateContainerFormGroup(GalleryGroup g)
        {
            ItemContainer c = new ItemContainer();
            c.LayoutOrientation = eOrientation.Horizontal;
            c.MultiLine = true;
            c.Name = "container_" + g.Name;

            foreach (BaseItem item in g.Items)
            {
                c.SubItems.Add(item.Copy());
            }

            return c;
        }
Exemple #12
0
        /// <summary>
        /// Copies the ButtonItem specific properties to new instance of the item.
        /// </summary>
        /// <param name="c">New ButtonItem instance.</param>
        protected override void CopyToItem(BaseItem c)
        {
            GalleryContainer copy = c as GalleryContainer;
            copy.DefaultSize = this.DefaultSize;
            copy.PopupGallerySize = this.PopupGallerySize;
            copy.StretchGallery = this.StretchGallery;
            copy.PopupUsesStandardScrollbars = this.PopupUsesStandardScrollbars;

            foreach (BaseItem item in this.PopupGalleryItems)
                copy.PopupGalleryItems.Add(item.Copy());

            

            base.CopyToItem(copy);

            // Copy Gallery Groups
            foreach (GalleryGroup group in this.GalleryGroups)
            {
                GalleryGroup groupCopy = new GalleryGroup();
                groupCopy.Name = group.Name;
                groupCopy.Text = group.Text;
                groupCopy.DisplayOrder = group.DisplayOrder;
                copy.GalleryGroups.Add(groupCopy);

                foreach (BaseItem item in group.Items)
                {
                    copy.SetGalleryGroup(copy.SubItems[item.Name], groupCopy);
                }
            }
        }
 public ActionResult CreateGallery(GalleryGroup model)
 {
     return(EditGallery(model));
 }
Exemple #14
0
		/// <summary>
		/// Adds new object to the collection.
		/// </summary>
		/// <param name="tab">Object to add.</param>
		/// <returns>Index of newly added object.</returns>
		public int Add(GalleryGroup tab)
		{
			return List.Add(tab);
		}
Exemple #15
0
		/// <summary>
		/// Adds new objects to the collection.
		/// </summary>
		/// <param name="groups">Array of groups to add.</param>
		public void AddRange(GalleryGroup[] groups)
		{
			foreach(GalleryGroup doc in groups)
				List.Add(doc);
		}
Exemple #16
0
		/// <summary>
		/// Returns index of the object inside of the collection.
		/// </summary>
		/// <param name="value">Reference to the object.</param>
		/// <returns>Index of the object.</returns>
		public int IndexOf(GalleryGroup value) 
		{
			return List.IndexOf(value);
		}
Exemple #17
0
		/// <summary>
		/// Inserts new object into the collection.
		/// </summary>
		/// <param name="index">Position of the object.</param>
		/// <param name="value">Object to insert.</param>
		public void Insert(int index, GalleryGroup value) 
		{
			List.Insert(index, value);
		}
Exemple #18
0
		/// <summary>
		/// Returns whether collection contains specified object.
		/// </summary>
		/// <param name="value">Object to look for.</param>
		/// <returns>true if object is part of the collection, otherwise false.</returns>
		public bool Contains(GalleryGroup value) 
		{
			return List.Contains(value);
		}
Exemple #19
0
		/// <summary>
		/// Copies contained items to the GalleryGroup array.
		/// </summary>
		/// <param name="array">Array to copy to.</param>
		internal void CopyTo(GalleryGroup[] array)
		{
			List.CopyTo(array,0);
		}
Exemple #20
0
 private LabelItem CreateLabelForGroup(GalleryGroup g)
 {
     LabelItem l = new LabelItem("label_" + g.Name, g.Text);
     if (Rendering.GlobalManager.Renderer is Rendering.Office2007Renderer)
     {
         Rendering.Office2007ColorTable ct = ((Rendering.Office2007Renderer)Rendering.GlobalManager.Renderer).ColorTable;
         l.BackColor = ct.Gallery.GroupLabelBackground;
         l.ForeColor = ct.Gallery.GroupLabelText;
         l.SingleLineColor= ct.Gallery.GroupLabelBorder;
         l.BorderType = eBorderType.SingleLine;
         l.BorderSide = eBorderSide.Bottom;
         l.PaddingTop = 1;
         l.PaddingLeft = 10;
         l.PaddingBottom = 1;
     }
     return l;
 }
Exemple #21
0
		/// <summary>
		/// Removes specified object from the collection.
		/// </summary>
		/// <param name="value"></param>
		public void Remove(GalleryGroup value) 
		{
			List.Remove(value);
		}
 public ActionResult CreateGallery(GalleryGroup model)
 {
     return EditGallery(model);
 }
Exemple #23
0
        /// <summary>
        /// Assigns the item to the gallery group.
        /// </summary>
        /// <param name="item">Item to assign.</param>
        /// <param name="group">Group to assign item to. Can be null to remove item assignment.</param>
        public void SetGalleryGroup(BaseItem item, GalleryGroup group)
        {
            if (item == null)
                throw new ArgumentNullException("item argument cannot be null.");

            if (group == null)
            {
                GalleryGroup g = GetItemGalleryGroup(item);
                if (g != null)
                    g.Items.Remove(item);
            }
            else
            {
                GalleryGroup g = GetItemGalleryGroup(item);
                if (g != null)
                    g.Items.Remove(item);
                group.Items.Add(item);
            }
        }
Exemple #24
0
		/// <summary>
		/// Copies collection into the specified array.
		/// </summary>
		/// <param name="array">Array to copy collection to.</param>
		/// <param name="index">Starting index.</param>
		public void CopyTo(GalleryGroup[] array, int index) 
		{
			List.CopyTo(array, index);
		}