Exemple #1
0
        public bool saveDetails()
        {
            //validate feilds  implement createdBy user
            bool myBool = false;
            int  myInt  = 0;

            try
            {
                newPlant.PlantID     = null; //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);
                if (myInt > 100)
                {
                    newPlant.PlantID = myInt;
                    myBool           = myPlantManager.AddPlantRegions(newPlant, regions);
                }
            }
            catch (Exception ax)
            {
                MessageBox.Show(ax.Message);
            }

            return(myBool);
        }