Пример #1
0
 protected void DetailsViewLifeDealItems_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
 {
     if (e.Exception != null)
     {
         e.ExceptionHandled = true;
         e.KeepInInsertMode = true;
         ValidationUtility.ShowValidationErrors(this, e.Exception);
     }
     else
     {
         if (GXGridView1.SelectedDataKey != null)
         {
             int GXgvSelectedValue = Convert.ToInt32(GXGridView1.SelectedValue);
             odsGridViewLifeDealItems.SelectParameters.Clear();
             odsGridViewLifeDealItems.SelectParameters.Add("lifeDealID", GXgvSelectedValue.ToString());
             GridViewLifeDealItems.DataBind();
         }
         else
         {
             int GXgvSelectedValue = GXGridView1SelectedValue;
             odsGridViewLifeDealItems.SelectParameters.Clear();
             odsGridViewLifeDealItems.SelectParameters.Add("lifeDealID", GXgvSelectedValue.ToString());
             GridViewLifeDealItems.DataBind();
         }
         mvMain.SetActiveView(viewBrokerages);
         mvLifeDealItems.SetActiveView(viewLifeDealItemsGrid);
     }
 }
Пример #2
0
    protected void btnBrokerages_Click(object sender, EventArgs e)
    {
        if (GXGridView1.SelectedIndex != -1)
        {
            if (GXGridView1.SelectedDataKey != null)
            {
                int GXgvSelectedValue = Convert.ToInt32(GXGridView1.SelectedValue);
                odsLifeDealPreview.SelectParameters.Clear();
                odsLifeDealPreview.SelectParameters.Add("id", GXgvSelectedValue.ToString());
                dvLifeDealPreview.DataBind();
                odsGridViewLifeDealItems.SelectParameters.Clear();
                odsGridViewLifeDealItems.SelectParameters.Add("lifeDealID", GXgvSelectedValue.ToString());
                GridViewLifeDealItems.DataBind();
            }
            else
            {
                int GXgvSelectedValue = GXGridView1SelectedValue;
                odsLifeDealPreview.SelectParameters.Clear();
                odsLifeDealPreview.SelectParameters.Add("id", GXgvSelectedValue.ToString());
                dvLifeDealPreview.DataBind();
                odsGridViewLifeDealItems.SelectParameters.Clear();
                odsGridViewLifeDealItems.SelectParameters.Add("lifeDealID", GXgvSelectedValue.ToString());
                GridViewLifeDealItems.DataBind();
            }

            mvMain.SetActiveView(viewBrokerages);
            mvLifeDealItems.SetActiveView(viewLifeDealItemsGrid);
            btnNew.CssClass        = "novZapis";
            btnEdit.CssClass       = "izmeni";
            btnDelete.CssClass     = "izbrisi";
            btnPreview.CssClass    = "osvezi";
            btnReport.CssClass     = "izvestaj";
            btnSearch.CssClass     = "prebaraj";
            btnBrokerages.CssClass = "brokerazi_Active";
        }
    }