Create the user interface for the Customer_Details form.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using SUP101WindowsMobile;
using Sybase.Collections;
using Sybase.Persistence;
namespace SUP101WindowsMobile
{
public partial class Customer_Details : Form
{
Customer thisCustomer;
public Customer_Details()
{
InitializeComponent();
}
private void submit_Click(object sender, EventArgs e)
{
thisCustomer.Fname = textBox2.Text;
thisCustomer.Lname = textBox3.Text;
thisCustomer.Save();
thisCustomer.SubmitPending();
ISynchronizationGroup sg = SUP101DB.GetSynchronizationGroup("default");
GenericList<ISynchronizationGroup> syncGroups = new GenericList<ISynchronizationGroup>();
syncGroups.Add(sg);
SUP101DB.BeginSynchronize(syncGroups, "");
Program.getForm1().Visible = true;
Program.getForm1().RefreshListItem(thisCustomer.SurrogateKey);
Program.getForm2().Visible = false;
}
private void AddDataToForm()
{
textBox1.Text = Program.getCustomer();
int id = Int32.Parse(Program.getCustomer());
thisCustomer = Customer.FindByPrimaryKey(id);
textBox2.Text = thisCustomer.Fname;
textBox3.Text = thisCustomer.Lname;
}
private void Customer_Details_Load(object sender, EventArgs e)
{
AddDataToForm();
}
private void Customer_Details_paint(object sender, PaintEventArgs e)
{
AddDataToForm();
}
}
}