コード例 #1
0
ファイル: Delete_Author.cs プロジェクト: hoangtien103/qltv
 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;
     }
 }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
ファイル: DAO_TacGia.cs プロジェクト: hoangtien103/qltv
        // 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);
        }
コード例 #4
0
 public bool updateTacGia(DTO_Tacgia tacgia)
 {
     return(daoTG.updateTacgia(tacgia));
 }
コード例 #5
0
 public bool insertTacGia(DTO_Tacgia tacgia)
 {
     return(daoTG.insertTacGia(tacgia));
 }