コード例 #1
0
        private void Updatebtn_Click(object sender, EventArgs e)
        {
            Suppliersdetails p = null;

            //formSupplierDetails formUpdateSupplier = new formSupplierDetails(p);
            //p = formUpdateSupplier.GetUpdateSupplier();
            if (p != null) //need to check if product is null or exception occurs
            {
                suppliers.Add(p);
            }
            RefreshsupplierList(suppliers);



            listView1.Items.Clear();
            foreach (Suppliersdetails c in suppliers)
            {
                ListViewItem lv1 = new ListViewItem(c.name);

                listView1.Items.Add(lv1);
            }

            //Clear text boxes
            Nametxt.Text = "";
        }
コード例 #2
0
        private void Hardcodesuppliers(List <Suppliersdetails> suppliers)
        {
            Suppliersdetails c1 = new Suppliersdetails("Bodk", "0894545444", "J street", "J company", "*****@*****.**", "approved");


            suppliers.Add(c1);
            RefreshsupplierList(suppliers);
        }
コード例 #3
0
 public void Update(Suppliersdetails newsuppliers)
 {
     this.name        = newsuppliers.name;
     this.Email       = newsuppliers.Email;
     this.phonenumber = newsuppliers.phonenumber;
     this.address     = newsuppliers.address;
     this.company     = newsuppliers.company;
     this.Status      = newsuppliers.Status;
 }
コード例 #4
0
        //public Suppliersdetails GetUpdateSupplier()
        //{
        //    if (supplierss != null)
        //    {
        //        Name2txt.Text = supplierss.name;
        //        ID2txt.Text = supplierss.id.ToString();
        //        Email2txt.Text = supplierss.Email;
        //        Address2txt.Text = supplierss.address;
        //        company2txt.Text = supplierss.address;
        //        Address2txt.Text = supplierss.address;
        //        vatno2txt.Text = supplierss.vatNo.ToString();

        //    }
        //    this.ShowDialog();
        //    return supplierss;
        //}



        public void CUbtn_Click(object sender, EventArgs e)
        {
            supplierss = new Suppliersdetails(Name2txt.Text, phonenumber2txt.Text, Email2txt.Text, Address2txt.Text, status2txt.Text, company2txt.Text);
            this.Close();
        }