コード例 #1
0
        private void btnrefresh_ItemClick(object sender, ItemClickEventArgs e)
        {
            PetToysModel ptm = new PetToysModel();

            petStoreDataSet4BindingSource.DataSource = ptm.GetAllPetToysToArrayList();
            gridControl1.DataSource = petStoreDataSet4BindingSource;
        }
コード例 #2
0
 private void bbiRestore_ItemClick(object sender, ItemClickEventArgs e)
 {
     if (ptIDSelected != "")
     {
         PetToysModel ptm = new PetToysModel();
         ptm.RestorePetToys(ptIDSelected);
         XtraMessageBox.Show("Restore successful !!!", "Successful", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         XtraMessageBox.Show("Please choose Toys item to restore !!!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
コード例 #3
0
        private void btndetail_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (ptIDSelected != "")
            {
                DetailToys   dts = new DetailToys();
                PetToysModel ptm = new PetToysModel();

                PetToy toy = ptm.getPetToys(ptIDSelected);

                dts.txtToysId.Text        = toy.pt_id;
                dts.txtToysName.Text      = toy.pt_name;
                dts.txtToySaleprices.Text = toy.pt_salePrice.ToString();
                dts.txtAmount.Text        = toy.pt_amount.ToString();
                dts.txtDescript.Text      = toy.pt_description;

                if (toy.pt_status == "Active")
                {
                    dts.txtstatus.ForeColor = Color.Green;
                }
                else
                {
                    dts.txtstatus.ForeColor = Color.Red;
                }

                dts.txtstatus.Text = toy.pt_status;

                dts.lblDetail.Text = "Pet's Toys detail for '" + toy.pt_name + "'";

                String projectPath = Path.GetFullPath(Path.Combine(Application.StartupPath, "..\\.."));
                String pathImage   = projectPath + "\\img\\" + toy.pt_image;
                Image  img         = Image.FromFile(pathImage);
                dts.ptbimage.Image = ptm.ResizeImage(img, 440, 440);

                dts.ShowDialog();
            }
            else
            {
                MessageBox.Show("Please choose a Toys to view detail !!!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
コード例 #4
0
        private void pt_idTextEdit_Properties_Click(object sender, EventArgs e)
        {
            PetToysModel ptm = new PetToysModel();

            pt_idTextEdit.Text = ptm.getNextID();
        }