Пример #1
0
        private void editContactbutton1_Click(object sender, EventArgs e)
        {
            Edit dlg = new Edit(this.loadedRow);

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                this.loadedRow    = dlg.RecordRow;
                edited            = true;
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
        }
Пример #2
0
        private void set_recordRow(DataSet1.recordDataRow record)
        {
            string gender = male.Checked ? "Male" : "Female";

            record.id         = idLoaded;
            record.relation   = this.relationBox.Text;
            record.title      = this.titleText.Text;
            record.first_name = this.fnameText.Text;
            record.mid_name   = this.midnameText.Text;
            record.last_name  = this.lnameText.Text;
            record.nickname   = this.nickText.Text;
            record.sex        = gender;
            if (this.dateTimePicker1.Checked)
            {
                record.birthdate = this.dateTimePicker1.Text;
            }
            record.note       = this.noteText.Text;
            record.photo      = this.pictureBox1.ImageLocation;
            record.pcity      = this.pcityText.Text;
            record.paddress   = this.paddressText.Text;
            record.pzip       = this.pzipText.Text;
            record.pstate     = this.pstateText.Text;
            record.scity      = this.scityText.Text;
            record.sddress    = this.saddText.Text;
            record.szip       = this.szipText.Text;
            record.sstate     = this.sstateText.Text;
            record.num1       = this.num1.Text;
            record.num2       = this.num2.Text;
            record.num3       = this.num3.Text;
            record.num4       = this.num4.Text;
            record.num5       = this.num5.Text;
            record.num6       = this.num6.Text;
            record.nnum1      = this.num1Text.Text;
            record.nnum2      = this.num2Text.Text;
            record.nnum3      = this.num3Text.Text;
            record.nnum4      = this.num4Text.Text;
            record.nnum5      = this.num5Text.Text;
            record.nnum6      = this.num6Text.Text;
            record.email      = this.emailText.Text;
            record.web        = this.webText.Text;
            record.wposition  = this.wpositionText.Text;
            record.wcompany   = this.wcopmanyText.Text;
            record.waddress   = this.waddressText.Text;
            record.wcity      = this.wcityText.Text;
            record.wzip       = this.wzipText.Text;
            record.wtelephone = this.wtelText.Text;
            record.wemail     = wemailText.Text;
            record.wweb       = wwebText.Text;
        }
Пример #3
0
 public Info(DataSet1.recordDataRow row)
 {
     InitializeComponent();
     this.Text = row.title + ' ' + row.first_name + ' ' + row.mid_name + ' ' + row.last_name;
     this.relationText.Text             = row.relation;
     this.nameText.Text                 = this.Text;
     this.nickText.Text                 = row.nickname;
     this.sexText.Text                  = row.sex;
     this.birthdateText.Text            = row.birthdate;
     this.noteText.Text                 = row.note;
     this.photoPictureBox.Image         = new Bitmap(row.photo);
     this.photoPictureBox.ImageLocation = row.photo;
     this.photoPictureBox.SizeMode      = PictureBoxSizeMode.StretchImage;
     this.pcityText.Text                = row.pcity;
     this.paddressText.Text             = row.paddress;
     this.pzipText.Text                 = row.pzip;
     this.pstateText.Text               = row.pstate;
     this.scityText.Text                = row.scity;
     this.saddText.Text                 = row.sddress;
     this.szipText.Text                 = row.szip;
     this.sstateText.Text               = row.sstate;
     this.num1.Text          = row.num1;
     this.num2.Text          = row.num2;
     this.num3.Text          = row.num3;
     this.num4.Text          = row.num4;
     this.num5.Text          = row.num5;
     this.num6.Text          = row.num6;
     this.nnum1.Text         = row.nnum1;
     this.nnum2.Text         = row.nnum2;
     this.nnum3.Text         = row.nnum3;
     this.nnum4.Text         = row.nnum4;
     this.nnum5.Text         = row.nnum5;
     this.nnum6.Text         = row.nnum6;
     this.emailText.Text     = row.email;
     this.webText.Text       = row.web;
     this.wpositionText.Text = row.wposition;
     this.companyText.Text   = row.wcompany;
     this.waddressText.Text  = row.waddress;
     this.wcityText.Text     = row.wcity;
     this.wzipText.Text      = row.wzip;
     this.wtelText.Text      = row.wtelephone;
     this.wemailText.Text    = row.wemail;
     this.wwebText.Text      = row.wweb;
     loadedRow = row;
 }
Пример #4
0
 public Info(DataSet1.recordDataRow row)
 {
     InitializeComponent();
     this.Text = row.title + ' ' + row.first_name + ' ' + row.mid_name + ' ' + row.last_name;
     this.relationText.Text = row.relation;
     this.nameText.Text = this.Text;
     this.nickText.Text = row.nickname;
     this.sexText.Text = row.sex;
     this.birthdateText.Text = row.birthdate;
     this.noteText.Text = row.note;
     this.photoPictureBox.Image = new Bitmap(row.photo);
     this.photoPictureBox.ImageLocation = row.photo;
     this.photoPictureBox.SizeMode=PictureBoxSizeMode.StretchImage;
     this.pcityText.Text = row.pcity;
     this.paddressText.Text = row.paddress;
     this.pzipText.Text = row.pzip;
     this.pstateText.Text = row.pstate;
     this.scityText.Text = row.scity;
     this.saddText.Text = row.sddress;
     this.szipText.Text = row.szip;
     this.sstateText.Text = row.sstate;
     this.num1.Text = row.num1;
     this.num2.Text = row.num2;
     this.num3.Text = row.num3;
     this.num4.Text = row.num4;
     this.num5.Text = row.num5;
     this.num6.Text = row.num6;
     this.nnum1.Text = row.nnum1;
     this.nnum2.Text = row.nnum2;
     this.nnum3.Text = row.nnum3;
     this.nnum4.Text = row.nnum4;
     this.nnum5.Text = row.nnum5;
     this.nnum6.Text = row.nnum6;
     this.emailText.Text = row.email;
     this.webText.Text = row.web;
     this.wpositionText.Text = row.wposition;
     this.companyText.Text = row.wcompany;
     this.waddressText.Text = row.waddress;
     this.wcityText.Text = row.wcity;
     this.wzipText.Text = row.wzip;
     this.wtelText.Text = row.wtelephone;
     this.wemailText.Text = row.wemail;
     this.wwebText.Text = row.wweb;
     loadedRow = row;
 }
Пример #5
0
        private void listView1_DoubleClick(object sender, EventArgs e)
        {
            int index = (int)listView1.SelectedItems[0].Tag;

            DataSet1.recordDataRow newRow = dataSet1.recordData.FindByid(index);
            Info dlg = new Info(newRow);

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                if (dlg.Edited)
                {
                    dataSet1.recordData.FindByid(index).ItemArray = dlg.LoadedRow.ItemArray;
                    updateListView(sort(filter()));
                    this.changed = true;
                    ShowItems();
                }
            }
        }
Пример #6
0
        public Edit()
        {
            InitializeComponent();
            RecordRow = dataSet1.recordData.NewrecordDataRow();
            pictureBox1.Load("no_photo.jpg");
            pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
            Color fore_color;

            fore_color = Color.FromKnownColor(KnownColor.InactiveCaptionText);
            foreach (Control ctl in groupBox2.Controls)
            {
                ctl.ForeColor = fore_color;
            }
            this.relationBox.SelectedIndex = 0;
            this.num1.SelectedIndex        = 0;
            this.num2.SelectedIndex        = 0;
            this.num3.SelectedIndex        = 0;
            this.num4.SelectedIndex        = 0;
            this.num5.SelectedIndex        = 0;
            this.num6.SelectedIndex        = 0;
        }
Пример #7
0
        private void editContact()
        {
            int index = (int)listView1.SelectedItems[0].Tag;

            DataSet1.recordDataRow newRow = dataSet1.recordData.FindByid(index);
            Edit dlg = new Edit(newRow);

            dlg.Text = "Edit Contact";
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                dataSet1.recordData.FindByid(index).ItemArray = dlg.RecordRow.ItemArray;
                if (dataSet1.recordData.FindByid(index).photo != "no_photo.jpg")
                {
                    string imagepath = dlg.RecordRow.photo;
                    string newPath   = photo_dir + string.Format("\\photo{0}" + System.IO.Path.GetExtension(imagepath), dataSet1.recordData.FindByid(index).id);
                    File.Copy(imagepath, newPath, true);
                    dataSet1.recordData.FindByid(index).photo = newPath;
                }
                updateListView(sort(filter()));
                this.changed = true;
                ShowItems();
                SaveFile();
            }
        }
Пример #8
0
 private void editContactbutton1_Click(object sender, EventArgs e)
 {
     Edit dlg = new Edit(this.loadedRow);
     if (dlg.ShowDialog() == DialogResult.OK)
     {
         this.loadedRow = dlg.RecordRow;
         edited = true;
         this.DialogResult = DialogResult.OK;
         this.Close();
     }
 }
Пример #9
0
 public Edit(DataSet1.recordDataRow row)
 {
     InitializeComponent();
     idLoaded              = row.id;
     RecordRow             = dataSet1.recordData.NewrecordDataRow();
     this.relationBox.Text = row.relation;
     this.titleText.Text   = row.title;
     this.fnameText.Text   = row.first_name;
     this.midnameText.Text = row.mid_name;
     this.lnameText.Text   = row.last_name;
     this.nickText.Text    = row.nickname;
     if (row.sex == "Male")
     {
         male.Checked = true;
     }
     else
     {
         female.Checked = true;
     };
     if (row.birthdate != null)
     {
         this.dateTimePicker1.Checked = true;
         this.dateTimePicker1.Value   = System.DateTime.Parse(row.birthdate);
     }
     this.noteText.Text             = row.note;
     this.pictureBox1.ImageLocation = row.photo;
     this.pictureBox1.Image         = new Bitmap(row.photo);
     this.pictureBox1.SizeMode      = PictureBoxSizeMode.StretchImage;
     this.pcityText.Text            = row.pcity;
     this.paddressText.Text         = row.paddress;
     this.pzipText.Text             = row.pzip;
     if (((row.scity.Length > 0) || (row.sddress.Length > 0)) ||
         ((row.szip.Length > 0) || (row.sstate.Length > 0)))
     {
         this.checkGroupBox2.Checked = true;
         this.groupBox2.Enabled      = true;
         this.pstateText.Text        = row.pstate;
         this.scityText.Text         = row.scity;
         this.saddText.Text          = row.sddress;
         this.szipText.Text          = row.szip;
         this.sstateText.Text        = row.sstate;
     }
     this.num1.Text          = row.num1;
     this.num2.Text          = row.num2;
     this.num3.Text          = row.num3;
     this.num4.Text          = row.num4;
     this.num5.Text          = row.num5;
     this.num6.Text          = row.num6;
     this.num1Text.Text      = row.nnum1;
     this.num2Text.Text      = row.nnum2;
     this.num3Text.Text      = row.nnum3;
     this.num4Text.Text      = row.nnum4;
     this.num5Text.Text      = row.nnum5;
     this.num6Text.Text      = row.nnum6;
     this.emailText.Text     = row.email;
     this.webText.Text       = row.web;
     this.wpositionText.Text = row.wposition;
     this.wcopmanyText.Text  = row.wcompany;
     this.waddressText.Text  = row.waddress;
     this.wcityText.Text     = row.wcity;
     this.wzipText.Text      = row.wzip;
     this.wtelText.Text      = row.wtelephone;
     this.wemailText.Text    = row.wemail;
     this.wwebText.Text      = row.wweb;
 }