Showing posts with label ITEMCOMMAND. Show all posts
Showing posts with label ITEMCOMMAND. Show all posts

Thursday, May 12, 2016

CAll METHODS IN TUNNEL PAGE BASED ON THE BUTTON CLICKED NEXT AND CANCEL FINISH.X++ CODE ENTERPRISE PORTAL : ITEMUPDATE ITEMCOMMAND

 CAll METHODS IN TUNNEL PAGE BASED ON THE BUTTON CLICKED NEXT AND CANCEL FINISH.X++ CODE ENTERPRISE PORTAL


protected void Page_Init(object sender, EventArgs e)
    {
        wizDetailsCreateTunnel.NextButtonClick += new WizardNavigationEventHandler(wizCreateTunnel_NextButtonClick);
        wizDetailsCreateTunnel.FinishButtonClick += new WizardNavigationEventHandler(wizCreateTunnel_FinishButtonClick);
        wizDetailsCreateTunnel.CancelButtonClick += new EventHandler(wizDetailsCreateTunnel_CancelButtonClick);
        this.Employee1Form.ItemCommand += new DetailsViewCommandEventHandler(EMP_ItemCommand);
        this.Employee1Form.ItemUpdated += new DetailsViewUpdatedEventHandler(Employee1Form_ItemUpdated);
        this.SetupMode();
       
    }

protected void EMP_ItemCommand(object sender, DetailsViewCommandEventArgs e)
    {
        if (e.CommandName == "Cancel")
        {
            this.EmpDataSourceView.CancelEdit();
            Boolean fetchEMP1Check;
            fetchEMP1Check = (Boolean)this.AxDataSource2.GetDataSet().DataSetRun.AxaptaObjectAdapter.Call("validateEMP1WInfo");
            //Proxy.Info obj = new Proxy.Info(this.AxSession.AxaptaAdapter);
            //obj.add(Proxy.Exception.Info, fetchEMP1Check.ToString());
            if (fetchEMP1Check == false)
            {
                this.AxDataSource2.GetDataSet().DataSetRun.AxaptaObjectAdapter.Call("deleteEMP");
            }
            //this.RedirectToPreviousPage();
        }
    }


    protected void Employee1Form_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
    {

        try
        {
            if (AxGridView4.Rows.Count > 0 && AxGridView4.EditIndex != -1)
            {
                this.AxGridView4.UpdateRow(AxGridView4.EditIndex, true);
                // Check the RowUpdating functionality threw any error.
                if (!rowUpdateSuccess) return;
            }            
        }
        catch (System.Exception ex)
        {
            AxExceptionCategory exceptionCategory;

            if (!AxControlExceptionHandler.TryHandleException(this, ex, out exceptionCategory))
            {
                // Throw the fatal exception
                throw;
            }
        }
        if (e.Exception == null)
        {
            Boolean fetchEMP1;
            fetchEMP1 = (Boolean)this.AxDataSource2.GetDataSet().DataSetRun.AxaptaObjectAdapter.Call("validateEMP1");

            /*if(fetchEMP1 == true)
                this.RedirectToPreviousPage();*/
        }

    }


Related Posts Plugin for WordPress, Blogger...