Exemplo n.º 1
0
        private void btnRemoveIntegration_Click(object sender, EventArgs e)
        {
            GridDataItem dataItem           = this.pointsToIntegrateGrid.SelectedItems[0] as GridDataItem;
            int          IntegrationPointId = Convert.ToInt32(GetDataItemValue(dataItem, "IntegrationPointId"));

            if (IntegrationPointId > 0)
            {
                string     ImportMessageIDCSV;
                List <int> importMessageIDs = new List <int>();
                importMessageIDs = GetImportMessageIDsForRemoval();
                if (importMessageIDs.Count > 0)
                {
                    ImportMessageIDCSV = String.Join(",", importMessageIDs);
                }
                else
                {
                    ImportMessageIDCSV = "";
                }
                bool          success  = false;
                Facade.IPoint facPoint = new Facade.Point();
                success = facPoint.DeletePointForIntegration(IntegrationPointId, ImportMessageIDCSV);

                if (success == true)
                {
                    Response.Redirect(Request.RawUrl);
                }
                else
                {
                    ClientScript.RegisterStartupScript(GetType(), "Error", "alert('Unable to delete the Point, please try again');", true);
                }
            }
        }