Ejemplo n.º 1
0
    protected void dvDataSource_Inserting(object sender, ObjectDataSourceMethodEventArgs e)
    {
        Broker.DataAccess.Order o = e.InputParameters["entityToInsert"] as Broker.DataAccess.Order;
        o.ValidateNumber();

        //ca.ValidateAccount();
    }
Ejemplo n.º 2
0
    protected void btnSearchOrderNumber_Click(object sender, EventArgs e)
    {
        TextBox tbOrderNumber = DetailsView1.FindControl("tbOrderNumber") as TextBox;

        Broker.DataAccess.Order o = Broker.DataAccess.Order.GetByOrderNumber(tbOrderNumber.Text);

        TextBox tbClientEMBG = DetailsView1.FindControl("tbClientEMBG") as TextBox;
        TextBox tbClientName = DetailsView1.FindControl("tbClientName") as TextBox;
        TextBox tbOwnerEMBG  = DetailsView1.FindControl("tbOwnerEMBG") as TextBox;
        TextBox tbOwnerName  = DetailsView1.FindControl("tbOwnerName") as TextBox;

        if (o != null)
        {
            OrderID               = o.ID;
            ClientID              = o.ClientID;
            OwnerID               = o.OwnerID;
            tbClientEMBG.Text     = o.Client.EMBG;
            tbClientEMBG.ReadOnly = true;
            tbClientName.Text     = o.Client.Name;
            tbClientName.ReadOnly = true;
            tbOwnerEMBG.Text      = o.Client1.EMBG;
            tbOwnerEMBG.ReadOnly  = true;
            tbOwnerName.Text      = o.Client1.Name;
            tbOwnerName.ReadOnly  = true;
        }
        else
        {
            tbClientEMBG.Text = string.Empty;
            tbClientName.Text = string.Empty;
            tbOwnerEMBG.Text  = string.Empty;
            tbOwnerName.Text  = string.Empty;
        }
    }
Ejemplo n.º 3
0
    protected void DetailsView1_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
    {
        if (e.Exception != null)
        {
            e.ExceptionHandled = true;
            e.KeepInInsertMode = true;
            ValidationUtility.ShowValidationErrors(this, e.Exception);
        }
        else
        {
            GXGridView1.TotalRecords = OrdersView.SelectCountCached();
            GXGridView1.DataBind();
            //mvMain.SetActiveView(viewGrid);

            string orderNumber        = e.Values["OrderNumber"] as string;
            Broker.DataAccess.Order o = Broker.DataAccess.Order.GetByOrderNumber(orderNumber);

            string DataKeyValue = o.ID.ToString();

            int intSelectedIndex = 0;
            int intPageIndex     = 0;
            int intGridViewPages = GXGridView1.PageCount;

            // Loop thru each page in the GridView
            for (int intPage = 0; intPage < intGridViewPages; intPage++)
            {
                // Set the current GridView page
                GXGridView1.PageIndex = intPage;
                // Bind the GridView to the current page
                GXGridView1.DataBind();
                // Loop thru each DataKey in the GridView
                for (int i = 0; i < GXGridView1.DataKeys.Count; i++)
                {
                    if (Convert.ToString(GXGridView1.DataKeys[i].Value) == DataKeyValue)
                    {
                        // If it is a match set the variables and exit
                        intSelectedIndex = i;
                        intPageIndex     = intPage;
                        break;
                    }
                }
            }

            // Set the GridView to the values found
            GXGridView1.PageIndex     = intPageIndex;
            GXGridView1.SelectedIndex = intSelectedIndex;
            GXGridView1.DataBind();

            int GXgvSelectedValue = o.ID;
            GXGridView1SelectedValue = GXgvSelectedValue;
            odsOrderPreview.SelectParameters.Clear();
            odsOrderPreview.SelectParameters.Add("id", GXgvSelectedValue.ToString());
            dvOrderPreview.DataBind();
            odsGridViewOrderItems.SelectParameters.Clear();
            odsGridViewOrderItems.SelectParameters.Add("orderID", GXgvSelectedValue.ToString());
            GridViewOrderItems.DataBind();
            mvMain.SetActiveView(viewOrderItems);
            mvOrderItems.SetActiveView(viewOrderItemsGrid);
        }
    }