StrataFrame Forum

BrowseDialog

http://forum.strataframe.net/Topic19211.aspx

By Rafael - 9/9/2008

How make a search name and return code in the BO ?
By Edhy Rijo - 9/9/2008

Hi Rafael,

This could be a very lenghty topic, so I would suggest you read the following topic "Using the Browse Dialog" in the help file and also to look at the SF sample projects, including StrataFlix, then if you have a more specific question, come back here with it.

By Rafael - 9/9/2008

I do not obtain to postar mine I doubt, the forum I return error
By Rafael - 9/9/2008

I already configured browserdialog but as to use in textbox with the data of the selected customer
By Edhy Rijo - 9/9/2008

Rafael,

The help file have detail information on how to use the Browse Dialog in the topic I posted before, also there is another topic "Adding a Browse Dialog to a Form" which explain in detail this process, it does not make sense to copy here what is already in detail in the help file.  Did you check this topic?

Also do you speak Spanish?

By Rafael - 9/9/2008

I Speak Portuguese.

When I open Designer of the Sample Strataframe BrowseDialog, have a erros :

The variable 'CustomersBO1' is either undeclared or was never assigned.
why ?

By Trent L. Taylor - 9/9/2008

First build the solution.  CustomersBO1 doesn't exist until you first build the solution so that the object actually exists.
By Edhy Rijo - 9/9/2008

Sample projects may have been created with previous version of SF, all you have to do is the following:

  • Close all open files.
  • Build the project or solution and that will take care of the problem.
By Rafael - 9/9/2008

thank all Smile

i study this example, if i have a doubt, i post Smile

By Ivan George Borges - 9/9/2008

Olá Rafael.

Not sure about what you are asking, but I guess you want to use the BrowseDialog as a pick list, called from a buttom somewhere on you form, is that right? Once you get back from the BrowseDialog, the Business Object that was set as the BusinessObjectToPopulate on the BrowseDialog properties, will be populate, as the property name says, with the results of your search, and pointing to the selected row.

So, all you need to do is to use whatever piece of information you need from it.

Lets say you want to find a Customer, and fill the CustomerName on your Orders form. You drop a buttom on the form, and put some code in its Click event, like the following, to call your BrowseDialog and set the Text property of your Customer textbox:

        If Me.MyBrowseDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then
            Me.txtCustomerName.Text = CustomersBO1.cus_Name
        End If

Does that help?

By Rafael - 9/9/2008

Campo.Text = sysFornecedorBO1.for_cod;

Campo2.Text = sysFornecedorBO1.for_nome;

Have a error:

Error 4 Cannot implicitly convert type 'int' to 'string' D:\GoLive Corporate\myForms\frmPedidoCompra.cs 207 33 GoLiveCorporate

The textbox of the MricoFur.Strataframe have a property of numbers ?

By Edhy Rijo - 9/9/2008

I think you have to convert it using CSTR()
By Rafael - 9/9/2008

I know that to convert but if have a solution in property of textbox i will use
By Rafael - 9/9/2008

I have a code:

private void btnLkpCondPagamento_Click(object sender, EventArgs e)

{

if (this.bdCondicaoDePagamento.ShowDialog() == DialogResult.OK)

{

cdp_cod.Text = Convert.ToString(sysPedidoCompraCondicaoDePagamento1.cdp_cod);

cdp_descr.Text = Convert.ToString(sysPedidoCompraCondicaoDePagamento1.cdp_descr);

}

}

But have a error :  The CurrentRow could not be evaluated because the CurrentRowIndex is out of range.  Business object record count: 0.  CurrentRowIndex: -1.

public System.Int32 cdp_cod

{

get

{

object loValue;

loValue = this.CurrentRow["cdp_cod"];

if (loValue == DBNull.Value)

{

return 0;

}

else

{

return (System.Int32)loValue;

}

}

set

{

this.CurrentRow["cdp_cod"] = value;

}

}

By Trent L. Taylor - 9/9/2008

That's right....you need to test on whether there is actually a record loaded in the BO because the CurrentRow relies on the CurrentRowIndex, which is a -1 if there are no records.  So add a test on the count around your code:

if(this.Count > 0)
{
   // Place your logic here
}
else
{
   // Take the empty BO into account
}
By Rafael - 9/9/2008

Yes but in my SqlServer have 70 registers and return of count = 0 , Why ?
By Ivan George Borges - 9/10/2008

Hi Rafael.

I think it is going to be hard to tell you "why", without knowing how you are fetching your data. The thing is, at the point you are getting an error, your BO is empty. Have a look at your fill methods and that might give you some clues.

By Trent L. Taylor - 9/10/2008

Yup....Ivan is right on the money Wink