Exemplo n.º 1
0
        private void FillForm()
        {
            txtIdDogodek.Text = model.idDogodek.ToString();

            ASPxGridLookupStranke.Value    = model.idStranka > 0 ? model.idStranka : -1;
            ASPxGridLookupKategorije.Value = model.idKategorija > 0 ? model.idKategorija : -1;
            ASPxGridLookupSkrbnik.Value    = model.Skrbnik > 0 ? model.Skrbnik : -1;
            ASPxGridLookupIzvajalec.Value  = model.Izvajalec > 0 ? model.Izvajalec : -1;
            ASPxGridLookupStatus.Value     = model.idStatus > 0 ? model.idStatus : -1;

            ASPxDateEditDatumOtvoritve.Date = model.DatumOtvoritve;
            ASPxDateEditDatumRok.Date       = model.Rok;
            txtDatumZadnjegaZaprtja.Text    = model.DatumZadZaprtja;
            ASPxMemoOpis.Text = model.Opis;

            ComboBoxTipDogodka.SelectedIndex = !String.IsNullOrEmpty(model.Tip) ? ComboBoxTipDogodka.Items.IndexOfValue(model.Tip) : 0;
            ASPxDateEditDatumRokIzvedbe.Date = model.RokIzvedbe.GetValueOrDefault();

            ASPxGridViewMessage.DataBind();
            ASPxGridView_Sestanek.DataBind();

            ASPxRoundPanel1.HeaderText = "Dogodek - " + (model.Stranka != null ? model.Stranka.NazivPrvi : "");
        }
Exemplo n.º 2
0
        protected void CallbackPanelMeeting_Callback(object sender, CallbackEventArgsBase e)
        {
            switch (e.Parameter)
            {
            case "2":
            {
                object valueID = null;
                if (ASPxGridView_Sestanek.VisibleRowCount > 0)
                {
                    valueID = ASPxGridView_Sestanek.GetRowValues(ASPxGridView_Sestanek.FocusedRowIndex, "DogodekSestanekID");
                }

                bool isValid1 = SetSessionsAndOpenPopUp(e.Parameter, Enums.EventSession.EventMeetingID, valueID);
                SetSessionsAndOpenPopUp(e.Parameter, Enums.EventSession.EventStatusID, model.idStatus);
                if (isValid1)
                {
                    ASPxEventMeetingNotes.ShowOnPageLoad = true;
                }
            }
            break;

            case "RefreshGrid":
                ASPxGridView_Sestanek.DataBind();
                break;

            default:
                bool isValid = false;
                if (action == (int)Enums.UserAction.Add)
                {
                    isValid = AddOrEditEntityObject(true);
                }

                EventMeetingModel modelNew = new EventMeetingModel();
                modelNew.DogodekID = GetEventDataProviderInstance().GetEventFullModel().idDogodek;
                modelNew.Datum     = DateTime.Now;
                modelNew.tsIDOsebe = PrincipalHelper.GetUserPrincipal().ID;

                if (e.Parameter.Equals(Enums.EventMeetingType.PRIPRAVA.ToString()))
                {
                    modelNew.Opis = htmlPriprava.Html;
                    modelNew.Tip  = Enums.EventMeetingType.PRIPRAVA.ToString();
                }
                else if (e.Parameter.Equals(Enums.EventMeetingType.POROCILO.ToString()))
                {
                    modelNew.Opis = htmlPorocilo.Html;
                    modelNew.Tip  = Enums.EventMeetingType.POROCILO.ToString();
                }

                EventMeetingModel newModel = CheckModelValidation(GetDatabaseConnectionInstance().SaveEventMeetingChanges(modelNew));
                if (newModel != null)
                {
                    GetEventDataProviderInstance().AddEventMeetingToEventModelSession(newModel);
                }
                else
                {
                    ShowClientPopUp("Commit save failed");
                }


                if (isValid)
                {
                    int idEvent = GetEventDataProviderInstance().GetEventFullModel().idDogodek;
                    AddValueToSession(Enums.CommonSession.ShowWarning, true);
                    ASPxWebControl.RedirectOnCallback(GenerateURI("EventsForm.aspx", (int)Enums.UserAction.Edit, idEvent.ToString()));
                }
                else
                {
                    ASPxGridView_Sestanek.DataBind();
                }
                break;
            }
        }