예제 #1
0
 public BoPhanSuDung Copy()
 {
     BoPhanSuDung kq = new BoPhanSuDung();
     kq.MaBoPhanSuDung = maBoPhanSuDung;
     kq.TenBoPhanSuDung = tenBoPhanSuDung;
     return kq;
 }
        private void btnDongY_Click(object sender, EventArgs e)
        {
            if (Them)
            {//Thêm
                BoPhanSuDung temp = new BoPhanSuDung();
                temp.MaBoPhanSuDung = txtMa.Text;
                temp.TenBoPhanSuDung = txtTen.Text;

                if (!CheckLoi(temp)) return;

                int kq = BoPhanSuDungBiz.AddBoPhanSuDung(temp);
                if (kq > 0) MSG.ThemThanhCong();
                else MSG.ThemThatBai();
            }
            else
            {//Sửa
                BoPhanSuDung temp = new BoPhanSuDung();
                temp.MaBoPhanSuDung = txtMa.Text;
                temp.TenBoPhanSuDung = txtTen.Text;
                int kq = BoPhanSuDungBiz.EditBoPhanSuDung(temp);
                if (kq > 0) MSG.SuaThanhCong();
                else MSG.SuaThatBai();
            }
            this.Close();
        }
예제 #3
0
        public BoPhanSuDung Copy()
        {
            BoPhanSuDung kq = new BoPhanSuDung();

            kq.MaBoPhanSuDung  = maBoPhanSuDung;
            kq.TenBoPhanSuDung = tenBoPhanSuDung;
            return(kq);
        }
예제 #4
0
 public static List<BoPhanSuDung> getListBoPhanSuDung()
 {
     List<BoPhanSuDung> kq = new List<BoPhanSuDung>();
     string sql = "SELECT [MaBoPhanSuDung],[TenBoPhanSuDung] FROM  [VNAAccounting].[dbo].[BoPhanSuDung]";
     System.Data.DataTable dt = DAL.CSDL.hienthi(sql);
     for (int i = 0; i < dt.Rows.Count; i++)
     {
         BoPhanSuDung temp = new BoPhanSuDung();
         temp.MaBoPhanSuDung = dt.Rows[i]["MaBoPhanSuDung"].ToString();
         temp.TenBoPhanSuDung = dt.Rows[i]["TenBoPhanSuDung"].ToString();
         kq.Add(temp);
     }
     return kq;
 }
 bool CheckLoi(BoPhanSuDung data)
 {
     bool kq = true;
     //mã bộ phận sử dụng rỗng
     if (string.IsNullOrEmpty(data.MaBoPhanSuDung))
     {
         MSG.ErrorStand("Bạn chưa nhập mã bộ phận sử dụng!");
         txtMa.Focus();
         return false;
     }
     //mã bộ phận sử dụng đã có trong cơ sở dữ liệu
     foreach (BoPhanSuDung item in frmDMBoPhanSuDung.Ldata)
     {
         if (item.MaBoPhanSuDung.ToUpper().Equals(txtMa.Text.ToUpper()))
         {
             MSG.ErrorStand("Mã bộ phận sử dụng đã có trong cơ sở dữ liệu!");
             txtMa.Focus();
             return false;
         }
     }
     return kq;
 }
예제 #6
0
 //------------------------------------------>
 private void DongY()
 {
     if (vtIndex == -1) return;
     switch (chose)
     {
         case CONFIG.ConstFrm.frmDMLoaiTaiSan:
             {
                 loaitaisan = Utils.DataGridViewRow_to_LoaiTaiSan(DataGridView.Rows[vtIndex]);
                 break;
             }
         case CONFIG.ConstFrm.frmDMTaiSan:
             {
                 taisan = Utils.DataGridViewRow_to_TaiSan(DataGridView.Rows[vtIndex]);
                 break;
             }
         case CONFIG.ConstFrm.frmDMPhanNhomTaiSan:
             {
                 phannhomtaisan = Utils.DataGridViewRow_to_PhanNhomTaiSan(DataGridView.Rows[vtIndex]);
                 break;
             }
         case CONFIG.ConstFrm.frmDMLyDoTangGiamTaiSan:
             {
                 lydotanggiamtaisan = Utils.DataGridViewRow_to_LyDoTangGiamTaiSan(DataGridView.Rows[vtIndex]);
                 break;
             }
         case CONFIG.ConstFrm.frmDMBoPhanHachToan:
             {
                 bophanhachtoan = Utils.DataGridViewRow_to_BoPhanHachToan(DataGridView.Rows[vtIndex]);
                 break;
             }
         case CONFIG.ConstFrm.frmDMPhanXuong:
             {
                 phanxuong = Utils.DataGridViewRow_to_PhanXuong(DataGridView.Rows[vtIndex]);
                 break;
             }
         case CONFIG.ConstFrm.frmDMPhi:
             {
                 phi = Utils.DataGridViewRow_to_Phi(DataGridView.Rows[vtIndex]);
                 break;
             }
         case CONFIG.ConstFrm.frmDMBoPhanSuDung:
             {
                 bophansusung = Utils.DataGridViewRow_to_BoPhanSuDung(DataGridView.Rows[vtIndex]);
                 break;
             }
         case CONFIG.ConstFrm.frmDMNguonVon:
             {
                 nguonvon = Utils.DataGridViewRow_to_NguonVon(DataGridView.Rows[vtIndex]);
                 break;
             }
         default:
             break;
     }
 }
예제 #7
0
 public static int EditBoPhanSuDung(BoPhanSuDung input)
 {
     string sql = "UPDATE [VNAAccounting].[dbo].[BoPhanSuDung] SET TenBoPhanSuDung = N'" + input.TenBoPhanSuDung + "' WHERE MaBoPhanSuDung = N'" + input.MaBoPhanSuDung.ToUpper() + "'";
     return DAL.CSDL.ThemSuaXoa(sql);
 }
예제 #8
0
 public static int DeleteBoPhanSuDung(BoPhanSuDung input)
 {
     string sql = "DELETE FROM [VNAAccounting].[dbo].[BoPhanSuDung] WHERE MaBoPhanSuDung = N'" + input.MaBoPhanSuDung.ToUpper() + "'";
     return DAL.CSDL.ThemSuaXoa(sql);
 }
예제 #9
0
 public static int AddBoPhanSuDung(BoPhanSuDung input)
 {
     string sql = "INSERT INTO [VNAAccounting].[dbo].[BoPhanSuDung]([MaBoPhanSuDung],[TenBoPhanSuDung]) VALUES(N'" + input.MaBoPhanSuDung.ToUpper() + "',N'" + input.TenBoPhanSuDung + "')";
     return DAL.CSDL.ThemSuaXoa(sql);
 }
예제 #10
0
 public static BoPhanSuDung DataGridViewRow_to_BoPhanSuDung(System.Windows.Forms.DataGridViewRow Input)
 {
     BoPhanSuDung kq = new BoPhanSuDung();
     kq.MaBoPhanSuDung = Input.Cells["MaBoPhanSuDung"].Value.ToString();
     kq.TenBoPhanSuDung = Input.Cells["TenBoPhanSuDung"].Value.ToString();
     return kq;
 }