protected void btnUpdate_Click(object sender, EventArgs e) { string CustomerNr = FormLayoutCustomer.GetNestedControlValueByFieldName("CustomerNr") == null ? string.Empty : FormLayoutCustomer.GetNestedControlValueByFieldName("CustomerNr").ToString(); string FirstName = FormLayoutCustomer.GetNestedControlValueByFieldName("FirstName") == null ? string.Empty : FormLayoutCustomer.GetNestedControlValueByFieldName("FirstName").ToString(); string LastName = FormLayoutCustomer.GetNestedControlValueByFieldName("LastName") == null ? string.Empty : FormLayoutCustomer.GetNestedControlValueByFieldName("LastName").ToString(); string Adress = FormLayoutCustomer.GetNestedControlValueByFieldName("Adress") == null ? string.Empty : FormLayoutCustomer.GetNestedControlValueByFieldName("Adress").ToString(); string ZipCode = FormLayoutCustomer.GetNestedControlValueByFieldName("ZipCode") == null ? string.Empty : FormLayoutCustomer.GetNestedControlValueByFieldName("ZipCode").ToString(); string Place = FormLayoutCustomer.GetNestedControlValueByFieldName("Place") == null ? string.Empty : FormLayoutCustomer.GetNestedControlValueByFieldName("Place").ToString(); string Country = FormLayoutCustomer.GetNestedControlValueByFieldName("Country") == null ? string.Empty : FormLayoutCustomer.GetNestedControlValueByFieldName("Country").ToString(); string Phone = FormLayoutCustomer.GetNestedControlValueByFieldName("Phone") == null ? string.Empty : FormLayoutCustomer.GetNestedControlValueByFieldName("Phone").ToString(); string MobilePhone = FormLayoutCustomer.GetNestedControlValueByFieldName("MobilePhone") == null ? string.Empty : FormLayoutCustomer.GetNestedControlValueByFieldName("MobilePhone").ToString(); string EMail = FormLayoutCustomer.GetNestedControlValueByFieldName("EMail") == null ? string.Empty : FormLayoutCustomer.GetNestedControlValueByFieldName("EMail").ToString(); var model = controller.GetCustomer(modelid); model.Adress = Adress; model.Country = Country; model.CustomerNr = Int32.Parse(CustomerNr); model.EMail = EMail; model.FirstName = FirstName; model.LastName = LastName; model.MobilePhone = MobilePhone; model.Phone = Phone; model.Place = Place; model.ZipCode = ZipCode; controller.UpdateCustomer(model); }
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(); }