public EditLectorDialog(SessionWraperFromWCF client, Lector lector) { InitializeComponent(); this.client = client; this.lector = lector; if (lector!=null) { if (lector.Name!=null) textBoxName.Text = lector.Name; if (lector.Birthday != null) try { dateTimePickerBirthday.Value = DateTime.Parse(lector.Birthday); } catch (Exception e) { } if (lector.LectorPhotoName != null) pictureBoxPhoto.Image = Image.FromFile(Lector.img + lector.LectorPhotoName); } }
private void buttonOK_Click(object sender, EventArgs e) { if (lector == null) lector = client.CreateLector(textBoxName.Text); else lector.Name = textBoxName.Text; lector.Birthday = dateTimePickerBirthday.Value.ToString("yyyy-MM-dd"); if (photoData !=null) lector.LectorPhotoData = photoData; Hide(); }
public void DeleteLector(Lector lector) { client.DeleteLector(key, lector.Id); }
public string GetLectorBirthday(Lector lector) { return client.GetLectorBirthdayById(key, lector.Id); }
public void SetLectorPhotoData(Lector lector, string data) { client.SetLectorPhotoData(key, lector.Id, data); }
public void AddLectorToSeminar(Lector lector, Seminar seminar) { client.AddLectorToSeminar(key, lector.Id, seminar.Id); }
public void SetLectorBirthday(Lector lector, string Birthday) { client.SetLectorBirthdayById(key, lector.Id, Birthday); }
public void SetLectorName(Lector lector, string Name) { client.SetLectorNameById(key, lector.Id, Name); }
public void RemoveLectorFromSeminar(Lector lector, Seminar seminar) { client.RemoveLectorFromSeminar(key, lector.Id, seminar.Id); }
public string GetLectorPhotoName(Lector lector) { return client.GetLectorPhotoName(key, lector.Id); }
public string GetLectorName(Lector lector) { return client.GetLectorNameById(key, lector.Id); }
public void RemoveLector(Lector lector) { sessionWraperFromWCF.RemoveLectorFromSeminar(lector, this); Lectors.Remove(lector); }
public void AddLector(Lector lector) { sessionWraperFromWCF.AddLectorToSeminar(lector, this); Lectors.Add(lector); }