0

I was wondering whether someone has another sources of info about modifiable forms at runtime + how to store them.

What I have:

I have 3 tables atm: Users (1 to many) Raports (1 to many) ThrashType

Raport class:

public class Raport
    {

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public Raport()
        {
            ThrashType = new HashSet<ThrashType>();
            //Raport = new HashSet<Raport>();
        }

        [Key]
        public int raport_id { get; set; }            
        public string who_did { get; set; }
        public string where_from { get; set; }     
        public DateTime creation_time { get; set; }
        public DateTime last_modyfication { get; set; }


        public virtual ICollection<ThrashType> ThrashType { get; set; }

        public virtual AspNetUsers AspNetUsers { get; set; } 
    }

ThrashType class:

public class ThrashType
    { 

        [Key] 
        public int Key { get; set; }

        //public string Name { get; set; } 
        //or type from dictionary that has around 100 words

        public int Quantity { get; set; } 

        //public string CreatorsName { get; set; } 

        public virtual Raport Raport { get; set; } 

    }

What I want:

  • create a form that user can modify (meaning appending another instances of ThrashType to a Raport which in turn will be assigned to certain User)
  • recreate form made by user from stored record (also with information about name, quantities and so on)
  • learn more about storing serialized data or mb inspiration for the database
  • get more articles or information sources that could provide help

What I've read:

What I don't know:

  • how to append next instances of ThrashType to Raport at runtime
  • after having the custom Raport (that has 1-many ThrashTypes) how to store it:

(by how I mean "which way would be best")

a) in database (it will later be analized by a set of queries I'll invent based on what client will say)
b) how to store it in SQL session state

What I wanted to do:

At first I thought that I could store information from form as a string that could be read from alghoritm later (like "10101011101" and position would say what kind of word from dictionary it is), but still it lacks the quantities. Querying string database for quantities seems like overkill-crazy idea. I'm thinking about mixing session and database - session for recreation of dropped work and database for storing ready reports that could be analized. Anyway I need your opinion and inspiration because it's killing me softly.

Even an answer to 1 part of this problem would be of very much needed and appriecieted help.

Thanks!

Community
  • 1
  • 1
Aleksander Dudek
  • 133
  • 1
  • 13
  • found this: http://blog.stevensanderson.com/2010/01/28/editing-a-variable-length-list-aspnet-mvc-2-style/ which explained a lot though can't get to the helper mentioned (BeginCollectionItem), because the link to the project is off - if anyone has a clue - would be grateful! – Aleksander Dudek Aug 23 '16 at 13:16
  • this helped a lot http://www.codexworld.com/add-remove-input-fields-dynamically-using-jquery/ – Aleksander Dudek Aug 24 '16 at 07:24

0 Answers0