示例#1
0
    protected void btnDelete_Click1(object sender, EventArgs e)
    {
        if (GXGridView1.SelectedIndex != -1)
        {
            int municipalityID = 0;
            if (GXGridView1.SelectedDataKey != null)
            {
                int GXgvSelectedValue = Convert.ToInt32(GXGridView1.SelectedValue);
                municipalityID = GXgvSelectedValue;
                dvDataSource.SelectParameters.Clear();
                dvDataSource.SelectParameters.Add("id", GXgvSelectedValue.ToString());
                DetailsView1.DataBind();
            }
            else
            {
                int GXgvSelectedValue = GXGridView1SelectedValue;
                municipalityID = GXgvSelectedValue;
                dvDataSource.SelectParameters.Clear();
                dvDataSource.SelectParameters.Add("id", GXgvSelectedValue.ToString());
                DetailsView1.DataBind();
            }
            Broker.DataAccess.Municipality m = Broker.DataAccess.Municipality.Get(municipalityID);
            m.IsActive = false;
            Broker.DataAccess.Municipality.Table.Context.SubmitChanges();

            GXGridView1.TotalRecords = ActiveMunicipality.SelectCountCached();
            GXGridView1.DataBind();
            mvMain.SetActiveView(viewGrid);
        }
    }
示例#2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         GXGridView1.TotalRecords = ActiveMunicipality.SelectCountCached();
         mvMain.SetActiveView(viewGrid);
         reportControl.BranchName  = BrokerHouseInformation.GetBrokerHouseNameByCode(BrokerHouseInformation.FIRST_ROW);
         reportControl.CompanyName = "Брокерско друштво";
     }
 }
示例#3
0
 protected void DetailsView1_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
 {
     if (e.Exception != null)
     {
         e.ExceptionHandled = true;
         e.KeepInEditMode   = true;
         ValidationUtility.ShowValidationErrors(this, e.Exception);
     }
     else
     {
         GXGridView1.TotalRecords = ActiveMunicipality.SelectCountCached();
         GXGridView1.DataBind();
         mvMain.SetActiveView(viewGrid);
     }
 }