Ejemplo n.º 1
0
        /// <summary>
        /// 5. Save or Update clients in the data base
        /// </summary>
        public void SaveClient(string idclient, string clientNumber, string name, string lastName, string email, string img, string address, string cardNumber, string nip, string idagencies, string idemployee, string sexe)
        {
            // we validate and convert data in the the Controller layer
            // we do not validate and convert data in the View layer
            // with idclient we update one row in the table

            // 1. Convert data
            int IDclient   = Convert.ToInt32(idclient);
            int IDagencies = Convert.ToInt32(idagencies);
            int IDemployee = Convert.ToInt32(idemployee);

            // 2. Save or update in the Model layer POO
            Model.vdclient      = IDclient;
            Model.vclientNumber = clientNumber;
            Model.vname         = name;
            Model.vlastName     = lastName;
            Model.vemail        = email;
            Model.vimg          = img;
            Model.vaddress      = address;
            Model.vcardNumber   = cardNumber;
            Model.vnip          = nip;
            Model.vidagencies   = IDagencies;
            Model.videmployee   = IDemployee;
            Model.vsexe         = sexe;
            Model.Save();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 5. Save or Update clients in the data base
        /// </summary>
        public void SaveClient(string idclient, string clientNumber, string name, string lastName, string email, string img, string address, string cardNumber, string nip, string idagencies, string idemployee, string sexe)
        {
            // we validate and convert data in the the Controller layer
            // we do not validate and convert data in the View layer
            // with idclient we update one row in the table

            // 1. Convert data
            int IDclient   = Convert.ToInt32(idclient);
            int IDagencies = Convert.ToInt32(idagencies);
            int IDemployee = Convert.ToInt32(idemployee);

            // 2. Save or update in the Model layer
            Model.Save(IDclient, clientNumber, name, lastName, email, img, address, cardNumber, nip, IDagencies, IDemployee, sexe);
        }