コード例 #1
0
        public bool saveDetails()
        {
            //validate feilds
            bool flag = false;

            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.ModifiedDate = DateTime.Now;
                newPlant.ModifiedBy   = user.UserID;


                flag = myPlantManager.EditPlant(newPlant, oldPlant);
            }
            catch (Exception ax)
            {
                MessageBox.Show(ax.Message);
            }

            return(flag);
        }