Ejemplo n.º 1
0
        protected void GridNoteView_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            List <Note> notes = (List <Note>)GridNoteView.DataSource;

            Note note     = new Note();
            var  newValue = e.NewValues;

            note.Date  = newValue["Date"] == null? DateTime.Now: (DateTime)newValue["Date"];
            note.Text  = newValue["Text"].ToString() ?? string.Empty;
            note.Title = newValue["Title"].ToString() ?? string.Empty;

            notes.Add(note);

            var model = Controller.GetData(ModelId);

            model.Notes = notes;
            Controller.Update(model);

            var Model = Controller.GetData(ModelId);

            e.Cancel = true;
            GridNoteView.CancelEdit();

            GridNoteView.DataSource = Model.Notes;
            GridNoteView.DataBind();
        }
Ejemplo n.º 2
0
 protected void GridNoteView_StartRowEditing(object sender, DevExpress.Web.Data.ASPxStartRowEditingEventArgs e)
 {
     if (GridNoteView.IsNewRowEditing)
     {
         GridNoteView.DoRowValidation();
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            Uri u = HttpContext.Current.Request.Url;

            ModelId = HttpUtility.ParseQueryString(u.Query).Get("id");

            var providermodel = controller.GetData(ModelId);

            var layoutmodel = controller.GetCoreLayoutData(providermodel);

            LayoutProvider.DataSource = layoutmodel;
            LayoutProvider.DataBind();

            var modelbookingprocess = controller.GetDataByProviderId(providermodel.ProviderId);

            GridBookingProcessView.DataSource = modelbookingprocess;
            GridBookingProcessView.DataBind();

            var model = controller.GetData(ModelId);

            GridNoteView.DataSource = model.Notes;
            GridNoteView.DataBind();

            GridProviderContactView.DataSource = model.Contacts;
            GridProviderContactView.DataBind();

            GridCancellationView.DataSource = model.Cancellations;
            GridCancellationView.DataBind();
        }
Ejemplo n.º 4
0
        protected void GridNoteView_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            List <Note> notes    = (List <Note>)GridNoteView.DataSource;
            string      id       = e.Keys[0].ToString();
            Note        note     = notes.Find(m => m.Id == id);
            var         newValue = e.NewValues;

            notes.Remove(note);
            note.Date  = newValue["Date"] == null ? DateTime.Now : (DateTime)newValue["Date"];
            note.Text  = newValue["Text"].ToString() ?? string.Empty;
            note.Title = newValue["Title"].ToString() ?? string.Empty;

            notes.Add(note);

            var model = controller.GetCustomer(modelid);

            model.Notes = notes;
            controller.UpdateCustomer(model);

            e.Cancel = true;
            GridNoteView.CancelEdit();

            GridNoteView.DataSource = notes;
            GridNoteView.DataBind();
        }
Ejemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Izvrsi event za incijalizaciju controllera
            OnInitController();

            var model = Controller.GetData(ModelId);

            GridProviderContactView.DataSource = model.Contacts;
            GridProviderContactView.DataBind();

            GridNoteView.DataSource = model.Notes;
            GridNoteView.DataBind();

            var layoutdata = Controller.GetLayoutData(model);

            FormLayoutProvider.DataSource = layoutdata;
            FormLayoutProvider.DataBind();
        }
Ejemplo n.º 6
0
        protected void GridNoteView_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            List <Note> notes = (List <Note>)GridNoteView.DataSource;
            string      id    = e.Keys[0].ToString();
            Note        note  = notes.Find(m => m.Id == id);

            notes.Remove(note);

            var model = Controller.GetData(ModelId);

            model.Notes = notes;
            Controller.Update(model);

            e.Cancel = true;
            GridNoteView.CancelEdit();

            GridNoteView.DataSource = notes;
            GridNoteView.DataBind();
        }
Ejemplo n.º 7
0
        protected void GridCustomerEmailView_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            List <CustomerContact> contacts = (List <CustomerContact>)GridCustomerEmailView.DataSource;
            string          id      = e.Keys[0].ToString();
            CustomerContact contact = contacts.Find(m => m.Id == id);

            contacts.Remove(contact);


            var model = controller.GetCustomer(modelid);

            model.Contacts = contacts;
            controller.UpdateCustomer(model);

            e.Cancel = true;
            GridNoteView.CancelEdit();

            GridCustomerEmailView.DataSource = contacts;
            GridCustomerEmailView.DataBind();
        }
Ejemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Uri u = HttpContext.Current.Request.Url;

            modelid = HttpUtility.ParseQueryString(u.Query).Get("id");
            var layoutmodel = controller.GetCustomerLayout(modelid);

            FormLayoutCustomer.DataSource = layoutmodel;
            FormLayoutCustomer.DataBind();

            var modelbookingprocess = controller.GetBookingProcessesByCustomerId(layoutmodel.CustomerNr);

            GridBookingProcessView.DataSource = modelbookingprocess;
            GridBookingProcessView.DataBind();

            var model = controller.GetCustomer(modelid);

            GridNoteView.DataSource = model.Notes;
            GridNoteView.DataBind();

            GridCustomerEmailView.DataSource = model.Contacts;
            GridCustomerEmailView.DataBind();
        }