Ejemplo n.º 1
0
        public static int Insert(NhanVien employee)
        {
            provider = new DataProvider();
            provider.Connect();

            string cmdStr = "Execute proc_AddEmployee N'" + employee.HoTen + "', "
                            + "'" + employee.NgaySinh.ToString("yyyy-MM-dd") + "', "
                            + "N'" + employee.GioiTinh + "', "
                            + "N'" + employee.DiaChi + "', "
                            + "'" + employee.SoDienThoai + "', "
                            + "'" + employee.NgayVaoLam.ToString("yyyy-MM-dd") + "', "
                            + "N'" + employee.ChucVu + "', "
                            + employee.Luong;

            int result = provider.ExecuteNonQuery(cmdStr);

            provider.Disconnect();
            return(result);
        }
Ejemplo n.º 2
0
 public static void thuephong(string maphong)
 {
     string query = string.Format("usp_thuephongmoi @map ={0}", maphong);
     var    u     = DataProvider.ExecuteNonQuery(query);
 }
Ejemplo n.º 3
0
        public static void PhucHoiDuLieu(string path)
        {
            string sql = "use master alter database [QuanLiTraSua] set Single_User with Rollback Immediate Restore database [QuanLiTraSua] from disk = N'" + path + "' with replace alter database [QuanLiTraSua] set Multi_User";

            DataProvider.ExecuteNonQuery(sql);
        }
Ejemplo n.º 4
0
        public static void CheckOut(int idBill, int GiamGia, float tongtien)
        {
            string query = "UPDATE dbo.HoaDon SET ngayra = GETDATE(), thanhtoan = 1" + ", giamgia = " + GiamGia + ", tongtien = " + tongtien + " WHERE id = " + idBill;

            DataProvider.ExecuteNonQuery(query);
        }
        public static bool UpDateAccount(string username, string dislayname, string pass1, string pass2)
        {
            int kq = (int)DataProvider.ExecuteNonQuery("EXEC dbo.UpdateAccount @username , @displayname , @pass1 , @pass2", new object[] { username, dislayname, pass1, pass2 });

            return(kq > 0);
        }
Ejemplo n.º 6
0
 public static void InsertBill(int idbanan)
 {
     DataProvider.ExecuteNonQuery("EXEC InsertBill @idbanan", new object[] { idbanan });
 }
Ejemplo n.º 7
0
        public bool ThemHoaDonKhongTheKH(HoaDonDTO dto)
        {
            string sql = "insert into HoaDon values(GETDATE(), " + dto.TongTien + "," + dto.TienGiam + ", " + dto.TienThanhToan + ", NULL, " + dto.NVLapHD + ")";

            return(dp.ExecuteNonQuery(sql));
        }
Ejemplo n.º 8
0
        public bool PhanCong(CTCaLamViecDTO dto)
        {
            string sql = "insert into CTCaLamViec values(" + dto.MaCa + "," + dto.MaNV + ",N'" + dto.CV + "')";

            return(dp.ExecuteNonQuery(sql));
        }
Ejemplo n.º 9
0
        public static void DeleteBillInfoByIdFood(int idfood)
        {
            string truyvan = string.Format("DELETE dbo.ChiTietHoaDon WHERE idthucan = {0}", idfood);

            DataProvider.ExecuteNonQuery(truyvan);
        }
Ejemplo n.º 10
0
 public static void InsertBillInfo(int idhoadon, int idthucan, int soluong)
 {
     DataProvider.ExecuteNonQuery("EXEC InsertBillInfo @idhoadon , @idthucan , @soluong", new object[] { idhoadon, idthucan, soluong });
 }
Ejemplo n.º 11
0
 public static void CapNhatChiPhi(int machiphi)
 {
     string query = string.Format("usp_updatechiphi @machiphi={0}", machiphi);
     var    u     = DataProvider.ExecuteNonQuery(query);
 }