public void ContainedFormStateChanged(Control container, Control grid, Control form, List <WACParameter> parms)
        {
            WACParameter wp = WACParameter.RemoveParameterType(parms, WACParameter.ParameterType.FormState);

            WACFormControl.FormState state = (WACFormControl.FormState)wp.ParmValue;
            ((WACFormControl)form).CurrentState = state;
            ServiceRequest sr = new ServiceRequest(container);

            sr.ServiceFor = form;
            sr.ParmList   = parms;
            switch (state)
            {
            case WACFormControl.FormState.Closed:

                //((WACGridControl)grid).InitControl(parms);
                break;

            //case WACFormControl.FormState.OpenView:
            //    break;
            //case WACFormControl.FormState.OpenInsert:
            //    break;
            case WACFormControl.FormState.OpenUpdate:

                break;

            //case WACFormControl.FormState.UpdateCanceled:
            //    break;
            case WACFormControl.FormState.ItemDeleted:
                sr.ServiceFor       = form;
                sr.ServiceRequested = ServiceFactory.ServiceTypes.CloseFormView;
                //OnServiceRequested(this, new ServiceRequestEventArgs(sr));
                ServiceFactory.Instance.ServiceRequest(sr);
                ((WACControl)container).UpdateControl(null);
                break;

            case WACFormControl.FormState.ItemInserted:
                WACParameter.RemoveAllButParameterType(parms, WACParameter.ParameterType.MasterKey);
                ((WACGridControl)grid).CurrentState = WACDataBoundListControl.ListState.ListEmpty;
                ((WACGridControl)grid).InitControl(parms);
                sr.ServiceFor       = form;
                sr.ServiceRequested = ServiceFactory.ServiceTypes.CloseFormView;
                ServiceFactory.Instance.ServiceRequest(sr);
                //OnServiceRequested(this, new ServiceRequestEventArgs(sr));
                ((WACControl)container).UpdateControl(null);
                break;

            case WACFormControl.FormState.ItemUpdated:
                break;

            default:
                //grid.Visible = ((WACControl)grid).DefaultVisibility;
                //form.Visible = ((WACControl)form).DefaultVisibility;
                //container.Visible = ((WACControl)container).DefaultVisibility;
                //if (up != null)
                //    up.Visible = ((WACContainer)container).DefaultVisibility;
                break;
            }
            //   this.UpdatePanelUpdate();
            sr = null;
        }
Пример #2
0
        public void ContainedFormStateChanged(Control container, Control filter, Control grid, Control form, List <WACParameter> parms)
        {
            WACParameter wp = WACParameter.RemoveParameterType(parms, WACParameter.ParameterType.FormState);

            WACFormControl.FormState state = (WACFormControl.FormState)wp.ParmValue;
            ((WACFormControl)form).CurrentState = state;
            ServiceRequest sr = new ServiceRequest(container);

            sr.ServiceFor = form;
            sr.ParmList   = parms;
            switch (state)
            {
            //case WACFormControl.FormState.Closed:
            //    grid.Visible = ((WACGridControl)grid).DefaultVisibility;
            //    filter.Visible = ((WACFilterControl)filter).DefaultVisibility;
            //    break;
            //case WACFormControl.FormState.OpenView:
            //    grid.Visible = ((WACGridControl)grid).IsActiveReadOnly;
            //    filter.Visible = ((WACFilterControl)filter).IsActiveReadOnly;
            //    break;
            //case WACFormControl.FormState.OpenInsert:
            //    grid.Visible = ((WACGridControl)grid).IsActiveInsert;
            //    filter.Visible = ((WACFilterControl)filter).IsActiveInsert;
            //    break;
            //case WACFormControl.FormState.OpenUpdate:
            //    break;
            case WACFormControl.FormState.UpdateCanceled:
                break;

            case WACFormControl.FormState.ItemDeleted:
                sr.ServiceFor       = grid;
                sr.ServiceRequested = ServiceFactory.ServiceTypes.OpenGridView;
                ServiceFactory.Instance.ServiceRequest(sr);
                break;

            case WACFormControl.FormState.ItemInserted:
                WACParameter.RemoveAllButParameterType(parms, WACParameter.ParameterType.SelectedKey);
                sr.ServiceFor       = grid;
                sr.ServiceRequested = ServiceFactory.ServiceTypes.FilteredGridViewList;
                ServiceFactory.Instance.ServiceRequest(sr);
                break;

            case WACFormControl.FormState.ItemUpdated:
                break;

            default:
                break;
            }
            this.UpdatePanelUpdate();
            sr = null;
        }