protected void Page_Load(object sender, EventArgs e)
 {
     SupplierBLL supBll = new SupplierBLL();
     var sup = supBll.GetAllSupplier();
     gvSupplierList.DataSource = sup;
     gvSupplierList.DataBind();
 }
        protected void bttnUpdate_Click(object sender, EventArgs e)
        {
            SupplierBLL supBll = new SupplierBLL();
            //Supplier sp = new Supplier();
            string Supplier_Code = txtSuppliercode.Text;
            string Supplier_Name = txtSuppliername.Text;
            string Contact_Name = txtContactname.Text;
            string phone = txtPhoneno.Text;
            string Fax = txtFaxno.Text;
            string Address = txtAddress.Text;
            string GST_RegNo = txtGstregno.Text;
            string email = txtEmail.Text;

            string s = supBll.Updatesupplier(Supplier_Code, Supplier_Name, Contact_Name, phone, Fax, Address, GST_RegNo, email);
            lblmsg.Text = s;
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            SupplierBLL supbll = new SupplierBLL();
            string gstregno = txtGstregno.Text;
            string suppliercode = txtSuppliercode.Text;
            string suppliername = txtSuppliername.Text;
            string contactname = txtContactname.Text;
            string phone = txtPhoneno.Text;
            string fax = txtFaxno.Text;
            string address = txtAddress.Text;
            string email = txtEmail.Text;

            string a = supbll.Createsupplier(gstregno, suppliercode, suppliername, contactname, phone, fax, address, email);

            Response.Redirect("~/UpdateSupplierInfo.aspx");
        }
        protected void ddlPONumber_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ddlPONumber.SelectedIndex != 0)
            {

                string ponum = ddlPONumber.SelectedValue;
                pendingPO = pobll.GetPurchaseOrderByPONum(ponum);

                EmployeeBLL emp = new EmployeeBLL();
                int orderById =(Int32)pendingPO.Ordered_By;
                //string supcode = ;

                SupplierBLL supbll = new SupplierBLL();
                Supplier sup = supbll.GetSupplierByCode(pendingPO.Supplier_Code);

                txtSupplierName.Text = sup.Supplier_Name;

                txtOrderBy.Text = emp.GetEmployeeNameById(orderById);
                txtOrderDate.Text = pendingPO.Order_Date.ToShortDateString();

                txtSupplierName.ReadOnly = true;
                txtOrderBy.ReadOnly = true;
                txtOrderDate.ReadOnly = true;

                List<PurchaseOrderDetail> pendingPOD = new List<PurchaseOrderDetail>();

                pendingPOD = podetailbll.GetPendingPODetails(ponum);

                gvPODetailList.Visible = true;

            }
        }