Exemplo n.º 1
0
        public EL.Registrations.Plantcategories Select(EL.Registrations.Plantcategories plantcategoryEL)
        {
            DataTable dt = null;

            using (var cmd = new MySqlCommand())
            {
                cmd.CommandText = "select * from plantcategories where plantcategoryid = @plantcategoryid";

                cmd.Parameters.AddWithValue("@plantcategoryid", plantcategoryEL.Plantcategoryid);

                dt = methods.executeQuery(cmd);
            }

            if (dt.Rows.Count > 0)
            {
                plantcategoryEL.Plantcategoryid = Convert.ToInt32(dt.Rows[0]["plantcategoryid"]);
                plantcategoryEL.Plantcategory   = dt.Rows[0]["plantcategory"].ToString();

                return(plantcategoryEL);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 2
0
        public frmPlant(int _plantcategoryid, Image img)
        {
            InitializeComponent();
            plantcategoryEL.Plantcategoryid = _plantcategoryid;

            plantcategoryEL = plantcategoryBL.Select(plantcategoryEL);

            lblPlantCategory.Text        = plantcategoryEL.Plantcategory;
            pbPlantCategoryPicture.Image = img;
        }
Exemplo n.º 3
0
        public frmPlantCRUD(string _s, EL.Registrations.Plants _plantEL, PL.Registrations.frmPlant _frmPlant, EL.Registrations.Plantcategories _plantcategoryEL)
        {
            InitializeComponent();

            plantcategoryEL = _plantcategoryEL;
            frmPlant        = _frmPlant;
            s = _s;

            if (s.Equals("ADD"))
            {
                ShowForm(true);

                lblHeader.Text = "Add Plant";

                plantEL = new EL.Registrations.Plants();

                oldFlower = path + "image-icon-png-8.png";
                plantEL.Plantflowerimage = oldFlower;

                oldWholePlant           = path + "image-icon-png-8.png";
                plantEL.Plantwholeimage = oldWholePlant;

                oldLeaves = path + "image-icon-png-8.png";
                plantEL.Plantleavesimage = oldLeaves;

                pbWholePlant.Image = Image.FromFile(path + "image-icon-png-8.png");
                pbLeaves.Image     = Image.FromFile(path + "image-icon-png-8.png");
                pbFlower.Image     = Image.FromFile(path + "image-icon-png-8.png");
            }

            else if (s.Equals("VIEW"))
            {
                View(_plantEL);
                pbCloseAdd.Visible = false;
            }
        }
Exemplo n.º 4
0
 public EL.Registrations.Plantcategories Select(EL.Registrations.Plantcategories plantcategoryEL)
 {
     return(plantcategoryDL.Select(plantcategoryEL));
 }