Ejemplo n.º 1
0
        private void btnAddAgency_Click(object sender, EventArgs e)
        {
            try
            {
                Vendor_DTO vendor = new Vendor_DTO();
                vendor.VendorID      = txtIDAgency.Text;
                vendor.VendorName    = txtNameAgency.Text;
                vendor.VendorAddress = txtAddressOfAgency.Text;
                vendor.VendorPhone   = txtNumberPhone.Text;

                if (txtIDAgency.Text == "" || txtNameAgency.Text == "" || txtAddressOfAgency.Text == "" || txtNumberPhone.Text == "")
                {
                    XtraMessageBox.Show("You have to fullfill vendor information!", "Notification", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    ClearDisplay();
                    return;
                }

                if (Vendor_BUS.InsertVendor(vendor))
                {
                    XtraMessageBox.Show("Vendor Info has been inserted sucessfully!", "Notification", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    LoadVendorList();
                    ClearDisplay();
                    return;
                }
            }
            catch
            {
                XtraMessageBox.Show("Insert Info Failed!", "Notification", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
        }
Ejemplo n.º 2
0
        public void btnDeleteAgency_Click(object sender, EventArgs e)
        {
            try
            {
                Vendor_DTO vendor = new Vendor_DTO();
                vendor.VendorID   = dtgvAgencyInfoList.CurrentRow.Cells["VendorID"].Value.ToString();
                vendor.VendorName = txtNameAgency.Text;

                if (txtIDAgency.Text == "" || txtNameAgency.Text == "" || txtAddressOfAgency.Text == "" || txtNumberPhone.Text == "")
                {
                    XtraMessageBox.Show("You have to choose at least one vendor to delete!", "Notification", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    ClearDisplay();
                    return;
                }

                if (Vendor_BUS.DeleteVendor(vendor))
                {
                    LoadVendorList();
                    XtraMessageBox.Show("Vendor Info has been deleted sucessfully!", "Notification", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    ClearDisplay();
                    return;
                }
            }catch
            {
                XtraMessageBox.Show("Delete Info Failed!", "Notification", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
        }
Ejemplo n.º 3
0
        private void LoadVendor()
        {
            List <Vendor_DTO> loadVendor = Vendor_BUS.LoadVendor();

            cmbVendor.DataSource    = loadVendor;
            cmbVendor.ValueMember   = "VendorID";
            cmbVendor.DisplayMember = "VendorName";
        }
Ejemplo n.º 4
0
        private void LoadVendor()
        {
            List <Vendor_DTO> loadVendor = Vendor_BUS.LoadVendor();

            cmbIDAgency.DataSource    = loadVendor;
            cmbIDAgency.ValueMember   = "VendorID";
            cmbIDAgency.DisplayMember = "VendorName";
            txtVendorId.Text          = cmbIDAgency.SelectedValue.ToString();
        }
Ejemplo n.º 5
0
        public void LoadVendorList()
        {
            List <Vendor_DTO> vendor = Vendor_BUS.LoadVendor();

            dtgvAgencyInfoList.DataSource = vendor;
        }