public Delete_Author(DTO_Tacgia authorInfo) { InitializeComponent(); this.authorId = authorInfo.MaTG; txtAuthorName.Text = authorInfo.TenTG; dtpNgaySinh.Text = authorInfo.NgaySinh; if (authorInfo.GioiTinh == 0) { radGTFemale.Checked = true; } else { radGTMale.Checked = true; } }
private bool InsertAuthor() { try { BUS_TacGia insertAuthor = new BUS_TacGia(); int gioitinh = 1; if (radGTMale.Checked == false) { gioitinh = 0; } DTO_Tacgia dtoAuthor = new DTO_Tacgia(0, txtAuthorName.Text, dtpNgaySinh.Value.ToString("MM/dd/yyyy"), gioitinh); insertAuthor.insertTacGia(dtoAuthor); return(true); } catch (Exception e) { return(false); } }
// Update Category public bool updateTacgia(DTO_Tacgia TG) { try { _conn.Open(); SqlCommand cmd = new SqlCommand(updateCommon(TG.TenTG, TG.NgaySinh, TG.GioiTinh, TG.MaTG), _conn); int rowNumber = cmd.ExecuteNonQuery(); if (rowNumber > 0) { return(true); } } catch (Exception e) { throw e; } finally { _conn.Close(); } return(false); }
public bool updateTacGia(DTO_Tacgia tacgia) { return(daoTG.updateTacgia(tacgia)); }
public bool insertTacGia(DTO_Tacgia tacgia) { return(daoTG.insertTacGia(tacgia)); }