Esempio n. 1
0
 public static Common.GalleryImage LoadGalleryImage(Guid galleryImageGuid)
 {
     Business.GalleryImage galleryImageController = new Business.GalleryImage();
     Common.GalleryImage   galleryImage           = new Common.GalleryImage();
     galleryImageController.Load(galleryImageGuid, galleryImage);
     return(galleryImage);
 }
        private void InitializePage()
        {
            btnSave.Attributes["onclick"] = "return validateRequiredFields();";
            btnSave.Text   = Language.GetString(btnSave.Text);
            btnCancel.Text = Language.GetString(btnCancel.Text);

            if (ActionType == "edit")
            {
                Common.GalleryImage galleryImage = Facade.GalleryImage.LoadGalleryImage(GalleryImageGuid);
                txtTitle.Text = galleryImage.Title;
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Common.GalleryImage galleryImage = new Common.GalleryImage();
            try
            {
                galleryImage.UserGuid   = UserGuid;
                galleryImage.Title      = Helper.GetString(txtTitle.Text);
                galleryImage.CreateDate = DateTime.Now;

                if (galleryImage.HasError)
                {
                    throw new Exception(galleryImage.ErrorMessage);
                }

                switch (ActionType)
                {
                case "insert":
                    if (!Facade.GalleryImage.Insert(galleryImage))
                    {
                        throw new Exception(Language.GetString("ErrorRecord"));
                    }
                    break;

                case "edit":
                    galleryImage.GalleryImageGuid = GalleryImageGuid;
                    if (!Facade.GalleryImage.Update(galleryImage))
                    {
                        throw new Exception(Language.GetString("ErrorRecord"));
                    }
                    break;
                }

                Response.Redirect(string.Format("/PageLoader.aspx?c={0}", Helper.Encrypt((int)Arad.SMS.Gateway.Business.UserControls.UI_GalleryImages_GalleryImage, Session)));
            }
            catch (Exception ex)
            {
                ShowMessageBox(ex.Message, string.Empty, "danger");
            }
        }
Esempio n. 4
0
 public bool Update(Common.GalleryImage galleryImage)
 {
     return(base.ExecuteSPCommand("Update",
                                  "@Guid", galleryImage.GalleryImageGuid,
                                  "@Title", galleryImage.Title));
 }
Esempio n. 5
0
 public static bool Update(Common.GalleryImage galleryImage)
 {
     Business.GalleryImage galleryImageController = new Business.GalleryImage();
     return(galleryImageController.Update(galleryImage));
 }
Esempio n. 6
0
 public static bool Insert(Common.GalleryImage galleryImage)
 {
     Business.GalleryImage galleryImageController = new Business.GalleryImage();
     return(galleryImageController.Insert(galleryImage) != Guid.Empty ? true : false);
 }