Esempio n. 1
0
        protected void btnSelectVendor_Click(object sender, EventArgs e)
        {
            if (VendorDDL.SelectedIndex == 0)
            {
                pnlInventory.Visible     = false;
                pnlVendorResults.Visible = false;
                MessageUserControl.ShowInfo("Missing Data", "Select a vendor from the drop down list");
            }
            else
            {
                MessageUserControl.TryRun(() =>
                {
                    pnlInventory.Visible     = true;
                    pnlVendorResults.Visible = true;
                    txtComments.Text         = "Comments";

                    // Vendors Controller to get orders
                    VendorsController sysmgr          = new VendorsController();
                    OrderDetailsController controller = new OrderDetailsController();
                    int vendorId          = int.Parse(VendorDDL.SelectedValue);
                    var info              = sysmgr.Purchasing_Vendor_Get(vendorId);
                    lblVendorName.Text    = info.Name;
                    lblVendorContact.Text = info.Contact;
                    lblPhone.Text         = info.Phone;
                    //txtComments.Text = info.Orders.Comment;
                    // Calculate Total
                    CalculateTotal(controller, vendorId);


                    var data = controller.Get_Active_Order(int.Parse(VendorDDL.SelectedValue));
                    OrderDetailsGridView.DataSource = data;
                    OrderDetailsGridView.DataBind();
                }, "Vendors Selection", "Active Order Retrieved");
            }
        }