Exemple #1
0
        protected void ImageButtonSearch_Click(object sender, ImageClickEventArgs e)
        {
            Client client = new Client();

            client.C_name = TextBoxSearch.Text;
            client        = client.Get_Client_info();
            if (string.IsNullOrEmpty(client.C_name))
            {
                // display error panel
                PanelErrorMessage.Visible = true;
                // hide result panel
                PanelClientInfo.Visible = false;
            }
            else
            {
                ViewState["C_Name"]     = client.C_name;
                PanelClientInfo.Visible = true;
                lblName.Text            = client.C_name;
                lblAddress.Text         = string.IsNullOrEmpty(client.Address) ? "لا يوجد" : client.Address;
                lblAccountNumber.Text   = string.IsNullOrEmpty(client.Account_Number) ? "لا يوجد" : client.Account_Number;

                GridViewPhones.DataSource = Client_Phone.Get_Client_Phones(client.C_name);
                GridViewPhones.DataBind();
            }
        }
Exemple #2
0
        protected void ImageButtonSearch_Click(object sender, ImageClickEventArgs e)
        {
            Supplier supplier = new Supplier();

            supplier.S_name = TextBoxSearch.Text;
            double Debts;

            supplier = supplier.Get_Supplier_info(out Debts);
            if (string.IsNullOrEmpty(supplier.S_name))
            {
                // display error panel
                PanelErrorMessage.Visible = true;
                // hide result panel
                PaenlSupplierInfo.Visible = false;
            }
            else
            {
                ViewState["S_Name"]       = supplier.S_name;
                PaenlSupplierInfo.Visible = true;
                lblName.Text          = supplier.S_name;
                lblAddress.Text       = string.IsNullOrEmpty(supplier.Address) ? "لا يوجد" : supplier.Address;
                lblAccountNumber.Text = string.IsNullOrEmpty(supplier.Account_Number) ? "لا يوجد" : supplier.Account_Number;

                GridViewPhones.DataSource = Supplier_Phone.Get_Supplier_Phones(supplier.S_name);
                GridViewPhones.DataBind();

                GridViewFaxs.DataSource = Supplier_Fax.Get_Supplier_Faxs(supplier.S_name);
                GridViewFaxs.DataBind();

                Get_Records(supplier.S_name);//Bind supplier records grid
                PanelNotes.Visible = false;
            }
        }
        protected void GridViewSuppliers_RowCommand(object sender, GridViewCommandEventArgs e)
        {   // Select Supplier info
            int      row_index     = ((GridViewRow)((LinkButton)e.CommandSource).NamingContainer).RowIndex;
            string   supplier_name = GridViewSuppliers.Rows[row_index].Cells[0].Text;
            Supplier supplier      = new Supplier();

            supplier.S_name = supplier_name;
            double debts;

            supplier                  = supplier.Get_Supplier_info(out debts);
            lblSupplier.Text          = supplier.S_name;
            lblAddress.Text           = supplier.Address;
            lblAccountNumber.Text     = supplier.Account_Number;
            GridViewPhones.DataSource = Supplier_Phone.Get_Supplier_Phones(supplier_name);
            GridViewPhones.DataBind();
            GridViewFaxs.DataSource = Supplier_Fax.Get_Supplier_Faxs(supplier_name);
            GridViewFaxs.DataBind();
            GridViewSuppliers.SelectedIndex = row_index;
            PanelSupplierInfo.Visible       = true;
            SetFocus(GridViewFaxs);
        }
 private void BindPhones(string client)
 {
     GridViewPhones.DataSource = Client_Phone.Get_Client_Phones(client);
     GridViewPhones.DataBind();
 }
 private void BindPhones(string supplier)
 {
     GridViewPhones.DataSource = Supplier_Phone.Get_Supplier_Phones(supplier);
     GridViewPhones.DataBind();
 }