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(); }
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(); }
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(); }
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(); }
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(); }
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(); }