Esempio n. 1
0
        public int DeleteDanhMuc(string TableName, string ID)
        {
            int roweffect = 0;

            try
            {
                sql = "Delete from " + TableName + " where ID='" + ID + "'";
                CConnection data = new CConnection(4);
                roweffect = data.setData(sql);
            }
            catch { }
            return(roweffect);
        }
Esempio n. 2
0
        public int UpdateDanhMuc(string TableName, string ID, string Ten, string Enable, string loaimay)
        {
            int roweffect = 0;

            try
            {
                sql = "Update " + TableName + " set Ten=N'" + Ten + "',Enable='" + Enable + "', loaimay='" + loaimay + "' where ID='" + ID + "'";

                CConnection data = new CConnection(4);
                roweffect = data.setData(sql);
            }
            catch { }
            return(roweffect);
        }
Esempio n. 3
0
        public int InsertDanhMuc(string TableName, string ID, string Ten, string Enable, string loai)
        {
            int roweffect = 0;

            try
            {
                sql = "Insert into " + TableName + "(ID,Ten,Enable,loaimay) values ('" + ID + "',N'" + Ten + "','" + Enable + "','" + loai + "')";

                CConnection data = new CConnection(4);
                roweffect = data.setData(sql);
            }
            catch { }
            return(roweffect);
        }
Esempio n. 4
0
        public int InsertDanhMuc_v_chidinh(string ID, string STT, string MaBN, string Loai, string mavp, string tenvp, string makp, DateTime ngayxoa, string nguoixoa, string Userid, string ngayCD, string soluong)
        {
            int roweffect = 0;

            try
            {
                sql = "Insert into v_chidinh(ID,STT,MaBN,loai,mavp,ten,makp,ngaythuchien,tennguoixoa,userid,ngaychidinh,soluong) values ('" + ID + "','" + STT + "','" + MaBN + "','" + Loai + "','" + mavp + "',N'" + tenvp + "','" + makp + "','" + string.Format("{0:yyyy/MM/dd}", ngayxoa) + "',N'" + nguoixoa + "','" + Userid + "','" + ngayCD + "'," + soluong + ")";

                CConnection data = new CConnection(3);
                roweffect = data.setData(sql);
            }
            catch { }
            return(roweffect);
        }
Esempio n. 5
0
        public int UpdateBaoTri(string ID, string NoiDung, DateTime Ngay)
        {
            int roweffect = 0;

            try
            {
                sql = "Update baotri set NoiDung=N'" + NoiDung + "',Ngay='" + f_formatDate(Ngay) + "' where ID='" + ID + "'";

                CConnection data = new CConnection();
                roweffect = data.setData(sql);
            }
            catch { }
            return(roweffect);
        }
Esempio n. 6
0
        public int InsertDanhMuc_btdbn(string MaBN, string Ten, string NamSinh, string DiaChi)
        {
            int roweffect = 0;

            try
            {
                sql = "Insert into btdbn(MaBN,Hoten,Namsinh,DiaChi) values ('" + MaBN + "',N'" + Ten + "','" + NamSinh + "',N'" + DiaChi + "')";

                CConnection data = new CConnection(3);
                roweffect = data.setData(sql);
            }
            catch { }
            return(roweffect);
        }
Esempio n. 7
0
        public int InsertCauHinh(string ID, string STT, string MaTB, string NoiDung)
        {
            int roweffect = 0;

            try
            {
                sql = "Insert into cauhinh(ID,STT,MaTB,NoiDUng) values ('" + ID + "','" + STT + "','" + MaTB + "',N'" + NoiDung + "')";

                CConnection data = new CConnection();
                roweffect = data.setData(sql);
            }
            catch { }
            return(roweffect);
        }
Esempio n. 8
0
        public int InsertCauHinhMaull(string ID, string MoTa)
        {
            int roweffect = 0;

            try
            {
                sql = "Insert into cauhinhmaull(ID,Ten) values ('" + ID + "',N'" + MoTa + "')";

                CConnection data = new CConnection();
                roweffect = data.setData(sql);
            }
            catch { }
            return(roweffect);
        }
Esempio n. 9
0
        public int InsertBaoTri(string ID, DateTime Ngay, string MaMay, string NoiDung)
        {
            int roweffect = 0;

            try
            {
                sql = "Insert into baotri(ID,Ngay,MaMay,NoiDung,ngaybd) values ('" + ID + "','" + f_formatDate(Ngay) + "','" + MaMay + "',N'" + NoiDung + "',now())";

                CConnection data = new CConnection();
                roweffect = data.setData(sql);
            }
            catch { }
            return(roweffect);
        }
Esempio n. 10
0
        public int InsertTiepNhanYC(string ID, string MaBN, string Hoten, string LoaiYC, string NoiDung, string NguoiYC, string KhoaPhong, string NguoiNhan, string HinhThuc, string TinhTrang, string HSD, string traituyen)
        {
            int roweffect = 0;

            try
            {
                sql  = "Insert into tiepnhanyc(ID,MaBN,Hoten,LoaiYeuCau,NoiDung,NguoiYeuCau,KhoaPhong, NguoiNhanYC,ThoiGianYC, ThoiGianKT,NgayUD,HinhThuc,TinhTrang,HSD,TraiTuyen) ";
                sql += " values ('" + ID + "','" + MaBN + "',N'" + Hoten + "','" + LoaiYC + "','" + NoiDung + "',N'" + NguoiYC + "','" + KhoaPhong + "'," + NguoiNhan + ",NOW(),NOW(),NOW(),'" + HinhThuc + "','" + TinhTrang + "','" + HSD + "','" + traituyen + "')";

                CConnection data = new CConnection(4);
                roweffect = data.setData(sql);
            }
            catch { }
            return(roweffect);
        }
Esempio n. 11
0
        public int InsertMay(string ID, string MaMay, string Ten, string NuocSX, string MaKP, string MaLoai, string loaichitiet, string DonGia, string ViTri, string tinhtrang, DateTime NgayBDSD)
        {
            int roweffect = 0;

            try
            {
                sql  = "Insert into May(ID,MaMay,Ten,NuocSX,MaKP,MaLoai,LoaiChiTiet,DonGia,Vitri,NgayUD,tinhtrang,ngaybdsd) ";
                sql += " values ('" + ID + "','" + MaMay + "',N'" + Ten + "','" + NuocSX + "','" + MaKP + "','" + MaLoai + "','" + loaichitiet + "'," + DonGia + ",'" + ViTri + "',now(),'" + tinhtrang + "','" + string.Format("{0:yyyy-MM-dd}", NgayBDSD) + "')";

                CConnection data = new CConnection();
                roweffect = data.setData(sql);
            }
            catch { }
            return(roweffect);
        }
Esempio n. 12
0
        public int UpdateTiepNhan_Done(string ID, string done, DateTime thoigiantra)
        {
            int roweffect = 0;

            try
            {
                sql  = "Update TiepNhanYC set done=" + done + ",thoigiankt='" + FormatYYYY_MM_DD_hh_ii(thoigiantra) + "' ";
                sql += "WHERE ID='" + ID + "'";


                CConnection data = new CConnection(4);
                roweffect = data.setData(sql);
            }
            catch { }
            return(roweffect);
        }
Esempio n. 13
0
        public int UpdateNoiDung(string ID, string NoiDung)
        {
            int roweffect = 0;

            try
            {
                sql  = "Update TiepNhanYC set Noidung=N'" + NoiDung + "' ";
                sql += "WHERE ID='" + ID + "'";


                CConnection data = new CConnection(3);
                roweffect = data.setData(sql);
            }
            catch { }
            return(roweffect);
        }
Esempio n. 14
0
        public int UpdateTiepNhan(string ID, string MaBN, string Hoten, string LoaiYC, string NoiDung, string NguoiYC, string KhoaPhong, string NguoiNhan, string HinhThuc, string TinhTrang)
        {
            int roweffect = 0;

            try
            {
                sql  = "Update TiepNhanYC set MaBN='" + MaBN + "',HoTen=N'" + Hoten + "',KhoaPhong='" + KhoaPhong + "',LoaiYeucau='" + LoaiYC + "'";
                sql += ",hinhthuc='" + HinhThuc + "',NguoiYeuCau=N'" + NguoiYC + "',NguoiNhanYC=" + NguoiNhan;
                sql += ",tinhtrang='" + TinhTrang + "',noidung=N'" + NoiDung + "' ";
                sql += "WHERE ID='" + ID + "'";


                CConnection data = new CConnection(4);
                roweffect = data.setData(sql);
            }
            catch { }
            return(roweffect);
        }
Esempio n. 15
0
        public int UpdateDanhMuc(string TableName, string ID, int Enable, bool tatca)
        {
            int roweffect = 0;

            try
            {
                sql = "Update " + TableName + " set Enable='" + Enable + "' where 1=1";
                if (tatca == false)
                {
                    sql += " and ID='" + ID + "'";
                }

                CConnection data = new CConnection(4);
                roweffect = data.setData(sql);
            }
            catch { }
            return(roweffect);
        }
Esempio n. 16
0
        public int UpdateMay(string ID, string MaMay, string Ten, string NuocSX, string MaKP, string MaLoai, string loaichitiet, string DonGia, string ViTri, string tinhtrang, DateTime NgayBDSD)
        {
            int roweffect = 0;

            try
            {
                sql  = "Update May set MaMay='" + MaMay + "',Ten=N'" + Ten + "',NuocSX='" + NuocSX + "',MaKP='" + MaKP + "'";
                sql += ",MaLoai='" + MaLoai + "',LoaiChiTiet='" + loaichitiet + "',DonGia=" + DonGia + ",Vitri='" + ViTri + "',NgayUD=now()";
                sql += ",tinhtrang='" + tinhtrang + "',ngaybdsd='" + string.Format("{0:yyyy-MM-dd}", NgayBDSD) + "' ";
                sql += "WHERE ID='" + ID + "'";


                CConnection data = new CConnection();
                roweffect = data.setData(sql);
            }
            catch { }
            return(roweffect);
        }