Exemplo n.º 1
0
        protected override void OnChanged(string propertyName, object oldValue, object newValue)
        {
            base.OnChanged(propertyName, oldValue, newValue);
            switch (propertyName)
            {
            case "ImageURLP03":
                if (oldValue != null && oldValue.ToString() != newValue.ToString())
                {
                    ValidateSystem.DeleteToServer(oldValue.ToString());
                }
                break;

            case "ImageURLP06":
                if (oldValue != null && oldValue.ToString() != newValue.ToString())
                {
                    ValidateSystem.DeleteToServer(oldValue.ToString());
                }
                break;

            case "ImageURLP07":
                if (oldValue != null && oldValue.ToString() != newValue.ToString())
                {
                    ValidateSystem.DeleteToServer(oldValue.ToString());
                }
                break;

            case "ImageURLP09":
                if (oldValue != null && oldValue.ToString() != newValue.ToString())
                {
                    ValidateSystem.DeleteToServer(oldValue.ToString());
                }
                break;
            }
        }
Exemplo n.º 2
0
 protected override void OnSaving()
 {
     base.OnSaving();
     Routing = ValidateSystem.RejectMarks(Title.ToLower(), "-");
     if (FileData != null)
     {
         if (!FileData.IsEmpty)
         {
             var    request    = System.Web.HttpContext.Current.Request;
             var    requestUrl = request.Url;
             string filePath   = request.MapPath("~/FileData/" + FileData.FileName);
             if (!System.IO.File.Exists(filePath))
             {
                 System.IO.Stream stream = new System.IO.FileStream(filePath, System.IO.FileMode.Create, System.IO.FileAccess.Write);
                 FileData.SaveToStream(stream);
                 var    currentPicture = System.Drawing.Image.FromStream(new System.IO.MemoryStream(FileData.Content));
                 var    thumbImage     = ImageHelper.ScaleImage(currentPicture, 70);
                 int    fileExtPos     = FileData.FileName.LastIndexOf(".");
                 string thumbPath      = "";
                 if (fileExtPos >= 0)
                 {
                     thumbPath = FileData.FileName.Substring(0, fileExtPos) + "_thumb" + System.IO.Path.GetExtension(FileData.FileName);
                 }
                 thumbImage.Save(request.MapPath("~/FileData/" + thumbPath));
                 stream.Close();
             }
             PresentationImageUrl = requestUrl.Scheme + "://" + requestUrl.Host + ":" + requestUrl.Port + "/FileData/" + FileData.FileName;
             FileData.Clear();
         }
     }
 }
Exemplo n.º 3
0
        protected override void OnSaving()
        {
            base.OnSaving();

            ImageURLP01 = ValidateSystem.SaveFileToServer(FileDataP01, "About");
            ImageURLP02 = ValidateSystem.SaveFileToServer(FileDataP02, "About");
            ImageURLP03 = ValidateSystem.SaveFileToServer(FileDataP03, "About");
        }
Exemplo n.º 4
0
        protected override void OnSaving()
        {
            base.OnSaving();

            ImageURLP03 = ValidateSystem.SaveFileToServer(FileDataP03, "About");
            ImageURLP06 = ValidateSystem.SaveFileToServer(FileDataP06, "About");
            ImageURLP07 = ValidateSystem.SaveFileToServer(FileDataP07, "About");
            ImageURLP08 = ValidateSystem.SaveFileToServer(FileDataP08, "About");
            ImageURLP09 = ValidateSystem.SaveFileToServer(FileDataP09, "About");
        }
Exemplo n.º 5
0
        protected override void OnSaving()
        {
            if (!(Session is NestedUnitOfWork) && Session.IsNewObject(this))
            {
                Code = CustomDistributedIdGeneratorHelper.Generate(this.Session.DataLayer, this.GetType(), true, Code);
            }

            ImageURL = ValidateSystem.SaveFileToServer(FileData, "Home");

            base.OnSaving();
        }
Exemplo n.º 6
0
        protected override void OnChanged(string propertyName, object oldValue, object newValue)
        {
            base.OnChanged(propertyName, oldValue, newValue);
            switch (propertyName)
            {
            case "Title":
                Routing = ValidateSystem.RejectMarks(Title, "-");
                break;

            case "TitleVN":
                RoutingVN = ValidateSystem.RejectMarks(TitleVN, "-");
                break;

            case "TitleRU":
                RoutingRU = ValidateSystem.RejectMarks(TitleRU, "-");
                break;
            }
        }
Exemplo n.º 7
0
 protected override void OnChanged(string propertyName, object oldValue, object newValue)
 {
     base.OnChanged(propertyName, oldValue, newValue);
     switch (propertyName)
     {
     case "ImageURLP01":
         if (oldValue != null && oldValue.ToString() != newValue.ToString())
         {
             ValidateSystem.DeleteToServer(oldValue.ToString());
         }
         break;
         //case "TitleVNP01":
         //    URLVNP02 = ValidateSystem.RejectMarks(TitleVNP01, "-");
         //    break;
         //case "TitleRUP01":
         //    URLRUP02 = ValidateSystem.RejectMarks(TitleRUP01, "-");
         //    break;
     }
 }
Exemplo n.º 8
0
 protected override void OnSaving()
 {
     base.OnSaving();
     ImageUrl = ValidateSystem.SaveFileToServer(FileData, "All");
 }