private void ContactTableView_InitNewRow(object sender, InitNewRowEventArgs e) { var row = ContactGrid.GetRow(e.RowHandle) as Contact; row.Customer = FocusedCustomer; row.RowState = Convert.ToInt16(ERowState.Active); FocusedContact = row; ContactGrid.Focus(); OnPropertyChanged("IsDataModified"); ContactGrid.FilterString = "RowState = 1"; }
public void Load(int contactID) { Customers = _dc.Customer.Where(x => x.RowState == Convert.ToInt16(ERowState.Active)); if (_dc.Contact.Any(x => x.ID == contactID)) { ContactGrid.Focus(); FocusedContact = _dc.Contact.Single(x => x.ID == contactID); FocusedCustomer = FocusedContact.Customer; } else { CustomerGrid.Focus(); }; }
/// <summary> /// Binds all the grids /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void BindGrids(object sender, EventArgs e) { CompanyGrid.DataBind(); DetailsView1.DataBind(); MarketGrid.DataBind(); CallCenterGrid.DataBind(); NotesList.DataBind(); EmailDeliveryGrid.DataBind(); ContactGrid.DataBind(); ContactEmailGrid.DataBind(); ContactPhoneGrid.DataBind(); BillingGrid.DataBind(); BillingEmailGrid.DataBind(); BillingPhoneGrid.DataBind(); }
protected override void OnPreRender(EventArgs e) { try { ContactGrid.ReloadData(); ContactControl.Contact = CurrentContact; if (CurrentContact != null) { JsonSerializer serializer = new JsonSerializer(); ContactHiddenField.Value = serializer.Serialize(CurrentContact); headTitle.Visible = true; } else { EmptySelectionControl.Visible = true; } } catch (Exception exception) { HandleException(exception); } base.OnPreRender(e); }
/// <summary> /// Based on the command name, update the database with the data. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSubmit_Click(object sender, CommandEventArgs e) { string commandType = e.CommandName; int id = 0; if (Request.QueryString["AID"] != null) { id = Convert.ToInt32(Request.QueryString["AID"]); } switch (commandType) { case "AddContact": rs.insertContact(txtCFirstName.Text, txtCLastName.Text, txtCAddress1.Text, txtCCity.Text, ddlCState.SelectedValue, txtCZip.Text, id); processDropDowns(id); ContactGrid.DataBind(); break; case "AddContactEmail": rs.insertContactEmail(txtCEmail.Text, Convert.ToInt32(ddlCEmail.SelectedValue), id); ContactEmailGrid.DataBind(); break; case "AddContactPhone": rs.insertContactPhone(txtCPhone.Text, Convert.ToInt32(ddlCPhone.SelectedValue), id); ContactPhoneGrid.DataBind(); break; case "AddBilling": rs.insertBilling(txtBFirstName.Text, txtBLastName.Text, txtBAddress1.Text, txtBCity.Text, ddlBState.SelectedValue, txtBZip.Text, id); processDropDowns(id); BillingGrid.DataBind(); break; case "AddBillingEmail": rs.insertBillingEmail(txtBEmail.Text, Convert.ToInt32(ddlBEmail.SelectedValue), id); BillingEmailGrid.DataBind(); break; case "AddBillingPhone": rs.insertBillingPhone(txtBPhone.Text, Convert.ToInt32(ddlBPhone.SelectedValue), id); BillingPhoneGrid.DataBind(); break; case "AddMarket": int mid = rs.insertMarket(txtMarketName.Text, txtMonthlyBudgets.Text, ddlStatus.SelectedValue, txtMarketZip.Text, txtExcludeZip.Text, id); foreach (ListItem s in ddlCallCenterName.Items) { rs.insertMarketCC(Convert.ToInt32(s.Value), "000-000-0000", mid, id, "Off"); } processDropDowns(id); MarketGrid.DataBind(); CallCenterGrid.DataBind(); break; case "AddMarketCC": rs.insertMarketCC(Convert.ToInt32(ddlCallCenterName.SelectedValue), txtCallCenterPhone.Text, Convert.ToInt32(ddlCCMarket.SelectedValue), id, ddlCCStatus.SelectedValue); CallCenterGrid.DataBind(); break; case "AddMarketEALD": rs.insertMarketEALD(id, txtEmailAddresses.Text); EmailDeliveryGrid.DataBind(); break; default: break; } foreach (Control x in this.Controls) { if (x is TextBox) { ((TextBox)x).Text = ((TextBox)x).ToolTip; } } }
private void GridButton_Click(object sender, RoutedEventArgs e) { var contactGrid = new ContactGrid(); this.NavigateTo(contactGrid); }