Example #1
0
 protected void DetailsViewRateDealItems_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);
             odsGridViewRateDealItems.SelectParameters.Clear();
             odsGridViewRateDealItems.SelectParameters.Add("rateDealID", GXgvSelectedValue.ToString());
             GridViewRateDealItems.DataBind();
         }
         else
         {
             int GXgvSelectedValue = GXGridView1SelectedValue;
             odsGridViewRateDealItems.SelectParameters.Clear();
             odsGridViewRateDealItems.SelectParameters.Add("rateDealID", GXgvSelectedValue.ToString());
             GridViewRateDealItems.DataBind();
         }
         mvMain.SetActiveView(viewRateDealItems);
         mvRateDealItems.SetActiveView(viewRateDealItemsGrid);
     }
 }
Example #2
0
    protected void btnRateDealItems_Click(object sender, EventArgs e)
    {
        if (GXGridView1.SelectedIndex != -1)
        {
            if (GXGridView1.SelectedDataKey != null)
            {
                int GXgvSelectedValue = Convert.ToInt32(GXGridView1.SelectedValue);
                odsRateDealPreview.SelectParameters.Clear();
                odsRateDealPreview.SelectParameters.Add("id", GXgvSelectedValue.ToString());
                dvRateDealPreview.DataBind();
                odsGridViewRateDealItems.SelectParameters.Clear();
                odsGridViewRateDealItems.SelectParameters.Add("rateDealID", GXgvSelectedValue.ToString());
                GridViewRateDealItems.DataBind();
            }
            else
            {
                int GXgvSelectedValue = GXGridView1SelectedValue;
                odsRateDealPreview.SelectParameters.Clear();
                odsRateDealPreview.SelectParameters.Add("id", GXgvSelectedValue.ToString());
                dvRateDealPreview.DataBind();
                odsGridViewRateDealItems.SelectParameters.Clear();
                odsGridViewRateDealItems.SelectParameters.Add("rateDealID", GXgvSelectedValue.ToString());
                GridViewRateDealItems.DataBind();
            }

            mvMain.SetActiveView(viewRateDealItems);
            mvRateDealItems.SetActiveView(viewRateDealItemsGrid);
            btnNew.CssClass           = "novZapis";
            btnEdit.CssClass          = "izmeni";
            btnPreview.CssClass       = "osvezi";
            btnReport.CssClass        = "izvestaj";
            btnSearch.CssClass        = "prebaraj";
            btnAttachments.CssClass   = "dokumenti";
            btnRateDealItems.CssClass = "stavki_Active";
        }
    }