Ejemplo n.º 1
0
        public int saveDetails()
        {
            //validate feilds  implement createdBy user
            //bool myBool = false;
            int myInt = 0;

            try
            {
                Plant newPlant = new Plant();

                newPlant.PlantID     = int.Parse(this.plantId.Text);
                newPlant.Name        = this.name.Text;
                newPlant.Type        = this.type.Text;
                newPlant.Category    = this.category.Text;
                newPlant.Season      = this.season.Text;
                newPlant.Description = this.description.Text;
                newPlant.CreatedDate = DateTime.Now;
                newPlant.CreatedBy   = user.UserID;

                myInt = myPlantManager.AddPlant(newPlant);
            }
            catch (Exception ax)
            {
                MessageBox.Show(ax.Message);
            }

            return(myInt);
        }