Example #1
0
 public NguonVon Copy()
 {
     NguonVon kq = new NguonVon();
     kq.MaNguonVon = maNguonVon;
     kq.TenNguonVon = tenNguonVon;
     return kq;
 }
        private void btnDongY_Click(object sender, EventArgs e)
        {
            if (Them)
            {//Thêm
                NguonVon temp = new NguonVon();
                temp.MaNguonVon = txtMa.Text;
                temp.TenNguonVon = txtTen.Text;

                if (!CheckLoi(temp)) return;

                int kq = NguonVonBiz.AddNguonVon(temp);
                if (kq > 0) MSG.ThemThanhCong();
                else MSG.ThemThatBai();
            }
            else
            {//Sửa
                NguonVon temp = new NguonVon();
                temp.MaNguonVon = txtMa.Text;
                temp.TenNguonVon = txtTen.Text;
                int kq = NguonVonBiz.EditNguonVon(temp);
                if (kq > 0) MSG.SuaThanhCong();
                else MSG.SuaThatBai();
            }
            this.Close();
        }
Example #3
0
        public NguonVon Copy()
        {
            NguonVon kq = new NguonVon();

            kq.MaNguonVon  = maNguonVon;
            kq.TenNguonVon = tenNguonVon;
            return(kq);
        }
Example #4
0
 public static List<NguonVon> getListNguonVon()
 {
     List<NguonVon> kq = new List<NguonVon>();
     string sql = "SELECT [MaNguonVon],[TenNguonVon] FROM  [VNAAccounting].[dbo].[NguonVon]";
     System.Data.DataTable dt = DAL.CSDL.hienthi(sql);
     for (int i = 0; i < dt.Rows.Count; i++)
     {
         NguonVon temp = new NguonVon();
         temp.MaNguonVon = dt.Rows[i]["MaNguonVon"].ToString();
         temp.TenNguonVon = dt.Rows[i]["TenNguonVon"].ToString();
         kq.Add(temp);
     }
     return kq;
 }
 bool CheckLoi(NguonVon data)
 {
     bool kq = true;
     //mã nguồn vốn rỗng
     if (string.IsNullOrEmpty(data.MaNguonVon))
     {
         MSG.ErrorStand("Bạn chưa nhập mã nguồn vốn!");
         txtMa.Focus();
         return false;
     }
     //mã nguồn vốn đã có trong cơ sở dữ liệu
     foreach (NguonVon item in frmDMNguonVon.Ldata)
     {
         if (item.MaNguonVon.ToUpper().Equals(txtMa.Text.ToUpper()))
         {
             MSG.ErrorStand("Mã nguồn vốn đã có trong cơ sở dữ liệu!");
             txtMa.Focus();
             return false;
         }
     }
     return kq;
 }
Example #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;
     }
 }
Example #7
0
 public static NguonVon DataGridViewRow_to_NguonVon(System.Windows.Forms.DataGridViewRow Input)
 {
     NguonVon kq = new NguonVon();
     kq.MaNguonVon = Input.Cells["MaNguonVon"].Value.ToString();
     kq.TenNguonVon = Input.Cells["TenNguonVon"].Value.ToString();
     return kq;
 }
Example #8
0
 public static int EditNguonVon(NguonVon input)
 {
     string sql = "UPDATE [VNAAccounting].[dbo].[NguonVon] SET TenNguonVon = N'" + input.TenNguonVon + "' WHERE MaNguonVon = N'" + input.MaNguonVon.ToUpper() + "'";
     return DAL.CSDL.ThemSuaXoa(sql);
 }
Example #9
0
 public static int DeleteNguonVon(NguonVon input)
 {
     string sql = "DELETE FROM [VNAAccounting].[dbo].[NguonVon] WHERE MaNguonVon = N'" + input.MaNguonVon.ToUpper() + "'";
     return DAL.CSDL.ThemSuaXoa(sql);
 }
Example #10
0
 public static int AddNguonVon(NguonVon input)
 {
     string sql = "INSERT INTO [VNAAccounting].[dbo].[NguonVon]([MaNguonVon],[TenNguonVon]) VALUES(N'" + input.MaNguonVon.ToUpper() + "',N'" + input.TenNguonVon + "')";
     return DAL.CSDL.ThemSuaXoa(sql);
 }