Exemplo n.º 1
0
        public void ThemHoatDong(ThongKeDTO tkDTO)
        {
            String SQL   = @"INSERT INTO ThongKe VALUES ('{0}', {1})";
            String query = string.Format(SQL, tkDTO.TenHoatDong, tkDTO.ChiPhi);

            DataProvider.ExecuteQuery(query);
        }
Exemplo n.º 2
0
        public void SuaThongTin(ThongKeDTO tk)
        {
            String updateSQL = @"UPDATE ThongKe SET TenHoatDong = N'{0}', ChiPhi = {1}";
            String query     = string.Format(updateSQL, tk.TenHoatDong, tk.ChiPhi);

            DataProvider.ExecuteQuery(query);
        }
Exemplo n.º 3
0
        public int ThemTua(ThongKeDTO obj)
        {
            int        result = 0;
            string     query  = " INSERT INTO " + obj.TenBang + " VALUES ('" + obj.Ngay + "','" + obj.MaNV + "','" + obj.MaDV + "', " + obj.ThoiGianDV + "," + obj.TienCer + "," + obj.TienMat + ")";
            DataConfig config = new DataConfig();

            result = config.fExecuteNoneQuery(query);

            return(result);
        }
Exemplo n.º 4
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            ThongKeDTO obj = new ThongKeDTO();
            //obj.STT = rowEnterIndex;
            QLThemDichVuBUS _Service = new QLThemDichVuBUS();

            _Service.XoaTua(TenBang, rowEnterIndex.ToString());
            //LoadDataDay();
            DataKhiChonNhanVien();
            LoadDataTab2();
        }
Exemplo n.º 5
0
        public List <ThongKeDTO> ThongKeDT(string str)
        {
            List <ThongKeDTO> ThongKeList = new List <ThongKeDTO>();
            DataTable         data        = DataProvider.Instance.ExecuteQuery("EXEC THONGKE @TUNGAY , @DENNGAY ", new object[] { str });

            foreach (DataRow item in data.Rows)
            {
                ThongKeDTO ThongKe = new ThongKeDTO(item);
                ThongKeList.Add(ThongKe);
            }
            return(ThongKeList);
        }
Exemplo n.º 6
0
        public List <ThongKeDTO> GetTHONGKE(DateTime TUNGAY, DateTime DENNGAY)
        {
            List <ThongKeDTO> list = new List <ThongKeDTO>();
            DataTable         data = DataProvider.Instance.ExecuteQuery("dbo.THONGKE_GETALL @TUNGAY , @DENNGAY ", new object[] { TUNGAY, DENNGAY });

            foreach (DataRow item in data.Rows)
            {
                ThongKeDTO thongke = new ThongKeDTO(item);
                list.Add(thongke);
            }
            return(list);
        }
Exemplo n.º 7
0
        public List <ThongKeDTO> GetListThongKe()
        {
            List <ThongKeDTO> list = new List <ThongKeDTO>();
            DataTable         data = DataProvider.Instance.ExecuteQuery("select IDGiay , TenGiay , SoLuong , DonGia , (SoLuong * DonGia) as N'TongTien' from GIAY");

            foreach (DataRow item in data.Rows)
            {
                ThongKeDTO tk = new ThongKeDTO(item);
                list.Add(tk);
            }
            return(list);
        }
Exemplo n.º 8
0
        protected void btn_Them_Click(object sender, EventArgs e)
        {
            ThongKeDTO tkDTO = new ThongKeDTO();

            tkDTO.TenHoatDong = tbTenHD.Text;
            tkDTO.ChiPhi      = (float)Convert.ToDouble(tbChiPhi.Text);

            ThongKeBUS tkBUS = new ThongKeBUS();

            tkBUS.ThemHoatDong(tkDTO);
            FilGVDanhSachHoatDong();
        }
Exemplo n.º 9
0
        public void insertThongke(int price)
        {
            int    valueMonth;
            int    valYear;
            string date = DateTime.Now.ToString();

            valueMonth = 3;
            valYear    = 2;

            ThongKeDTO TK = new ThongKeDTO(price, valYear, date, valueMonth, tenSPG);

            _Thongke.ThemThongKe(TK);
        }
Exemplo n.º 10
0
        public ThongKeDTO LayThongTin(string tendangnhap)
        {
            ThongKeDTO ThongKeDTO = null;
            String     query      = string.Format("SELECT * FROM NguoiDung WHERE TenDangNhap = '{0}'", tendangnhap);
            DataTable  dt         = DataProvider.ExecuteQuery(query);

            if (dt.Rows.Count > 0)
            {
                ThongKeDTO thongKeDTO = new ThongKeDTO();
                thongKeDTO.MaHoatDong  = Convert.ToInt32(dt.Rows[0]["MaHoatDong"]);
                thongKeDTO.TenHoatDong = dt.Rows[0]["TenHoatDong"].ToString();
                thongKeDTO.ChiPhi      = Convert.ToInt64(dt.Rows[0]["ChiPhi"]);
            }
            return(ThongKeDTO);
        }
Exemplo n.º 11
0
        public List <ThongKeDTO> LayDanhSach()
        {
            List <ThongKeDTO> listThongKeDTO = new List <ThongKeDTO>();

            String    query = "SELECT * FROM ThongKe";
            DataTable dt    = DataProvider.ExecuteQuery(query);

            foreach (DataRow dr in dt.Rows)
            {
                ThongKeDTO thongKeDTO = new ThongKeDTO();
                thongKeDTO.MaHoatDong  = Convert.ToInt32(dr["MaHoatDong"]);
                thongKeDTO.TenHoatDong = dr["TenHoatDong"].ToString();
                thongKeDTO.ChiPhi      = (float)Convert.ToDouble(dr["ChiPhi"]);
                listThongKeDTO.Add(thongKeDTO);
            }
            return(listThongKeDTO);
        }
Exemplo n.º 12
0
        private void btnThem_Click(object sender, EventArgs e)
        {
            try
            {
                fAdmin     f   = new fAdmin();
                ThongKeDTO obj = new ThongKeDTO();
                obj.TenBang = f.LoadTenBangFromComboBox();
                obj.Ngay    = f.GetDay();
                obj.MaNV    = cmbTenNV.SelectedValue.ToString();
                obj.MaDV    = cmbTenDV.Text.ToString();

                obj.TienCer = int.Parse(txbCertificat.Text.Trim());
                obj.TienMat = int.Parse(txbTienMat.Text.Trim());

                QLThemDichVuBUS _Service = new QLThemDichVuBUS();
                obj.ThoiGianDV = _Service.GetThoiGian(cmbTenDV.Text.ToString());
                _Service.ThemTua(obj);
                //f.DataKhiChonNhanVien();
            }
            catch (Exception exp)
            {
                MessageBox.Show("Thêm bị lỗi: " + exp.Message, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Exemplo n.º 13
0
 public bool ThemThongKe(ThongKeDTO TK)
 {
     return(ThongKeDAL.Instance.insertThongKe(TK));
 }
Exemplo n.º 14
0
 public void ThemHoatDong(ThongKeDTO tkDTO)
 {
     thongKeDAO.ThemHoatDong(tkDTO);
 }
Exemplo n.º 15
0
 public void SuaThongTin(ThongKeDTO kt)
 {
     thongKeDAO.SuaThongTin(kt);
 }