Exemplo n.º 1
0
        private void DocChiPhiDonHang()
        {
            ketnoi kn = new ketnoi();

            gridControl3.DataSource = kn.laybang(@"select NcrDatHangID,NcrID,
                DonHangID Iden,ChiPhiDonHang,Thongtin,Kg,Cai from 
                NcrDatHang where NcrID=" + txtNcrID.Text + "");
            kn.dongketnoi();
            this.gridView3.OptionsSelection.MultiSelectMode
                = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CheckBoxRowSelect;
        }
Exemplo n.º 2
0
        private void DocNguyenCong()
        {
            ketnoi kn = new ketnoi();

            gridControl2.DataSource = kn.laybang(@"select Masp,Tensp,NguyenCong,Tothuchien,
                Tencondoan,HeSoDinhMuc,Dongia_CongDoan,
                Dinhmuc,id,NguoiHC_CV,NgayHC_CV
                from tblDMuc_LaoDong");
            kn.dongketnoi();
            gridView2.ExpandAllGroups();
        }
Exemplo n.º 3
0
        private void DocDSNguonLuc()//GridlookupEdit Repository chọn mã nguồn lực trong gridcontrol Áp mã nguồn lực
        {
            ketnoi Connect = new ketnoi();

            repository.DataSource    = Connect.laybang(@"SELECT Ma_Nguonluc,
                Ten_Nguonluc,Nguoi,Ngay FROM tblResources");
            repository.DisplayMember = "Ma_Nguonluc";
            repository.ValueMember   = "Ma_Nguonluc";
            repository.NullText      = null;
            Connect.dongketnoi();
        }
Exemplo n.º 4
0
        private void DanhSachSanPham()
        {
            ketnoi kn = new ketnoi();

            gridControl1.DataSource = kn.laybang(@"select Code,SP.Masp,Tensp,Hotennv,
            SP.Ngaylap,NC.MaSP NguyenCong from tblSANPHAM SP
			left outer join (select MaSP from NguyenCong group by MaSP) NC
			on SP.Masp=NC.MaSP
			ORDER BY Code DESC"            );
            kn.dongketnoi();
        }
Exemplo n.º 5
0
        private void DocTatCaDSSanPham()
        {
            ketnoi kn = new ketnoi();

            grDanhMucSanPham.DataSource = kn.laybang(@"select check1,check2,Case when ISNUMERIC (right(Masp,4)) >0 then right(Masp,4) 
                       end TT, Masp, Tensp, Kichthuoc, Vatlieu,
                       Dacdiem, Ngaylap, KH.MKH, KH.TenKH, sp.manv,
                       hotennv, Code from tblSANPHAM SP left outer join tblKHACHHANG KH
                       on SP.Makh = KH.MKH ORDER BY TT DESC");
            kn.dongketnoi();
        }
Exemplo n.º 6
0
        public void DocDSSanPhamTheoNgay()
        {
            ketnoi kn       = new ketnoi();
            string sqlQuery = string.Format(@"select check1,check2,Masp,Tensp,Kichthuoc,Vatlieu, 
              Dacdiem, Ngaylap, KH.MKH, KH.TenKH, sp.manv, hotennv,Code 
              from tblSANPHAM SP left outer join tblKHACHHANG KH 
              on SP.Makh = KH.MKH");

            grDanhMucSanPham.DataSource = kn.laybang(sqlQuery);
            kn.dongketnoi();
        }
Exemplo n.º 7
0
        private void btnTongSLXuatKho_Click(object sender, EventArgs e)
        {
            ketnoi kn = new ketnoi();

            gridControl4.DataSource = kn.laybang(@"select T11.*,PT.KetThucTo11,PT.tyle from tbl11 T11 left outer join
            PHANTICH_TIENDO11 PT on T11.IDSP=PT.IDSP where 
            ngaynhan between '" + dpTu.Value.ToString("yyyy/MM/dd") + "' and '" + dpDen.Value.ToString("yyyy/MM/dd") + "'");
            kn.dongketnoi();
            gridView5.Columns["MaGH"].GroupIndex = 0;
            gridView5.ExpandAllGroups();
        }
Exemplo n.º 8
0
        private void BanHangDanhMuc()
        {
            ketnoi kn = new ketnoi();

            gridControl1.DataSource = kn.laybang(@"select BanHangID,DatHangID,
                        DonHangID,MaDH,SoLuongDonHang,Dongia,
                        ThanhTien,MaSP,TenGoiNhaMay,MaSPKhachHang,TenGoiKhachHang,
                        MaPO,NgayTao,NguoiTao,NguoiHC,NgayHC from BanHang where NgayTao between '" + dptu_ngay.Value.ToString("yyyy/MM/dd") + "' and '" + dpden_ngay.Value.ToString("yyyy/MM/dd") + "'");
            kn.dongketnoi();
            gridView1.Columns["DatHangID"].GroupIndex = -1;
        }
Exemplo n.º 9
0
        private void UcKHUON_CATDAY_Load(object sender, EventArgs e)
        {
            ketnoi kn = new ketnoi();

            txtuser.Text = Login.Username;
            cbmanhom_khuon.DataSource    = kn.laybang("select Manhom_khuon from tblDMNHOM_KHUON");
            cbmanhom_khuon.DisplayMember = "Manhom_khuon";
            cbmanhom_khuon.ValueMember   = "Manhom_khuon";
            kn.dongketnoi();
            MaNV(); LayTenKhuon(); Autocomplete_Dacdiemkhuon();
        }
Exemplo n.º 10
0
        void DSToThucHien()
        {
            ketnoi Connect = new ketnoi();

            repositoryItemToThucHien.DataSource    = Connect.laybang(@"
                select BoPhan  from tblPHONGBAN_TK");
            repositoryItemToThucHien.DisplayMember = "BoPhan";
            repositoryItemToThucHien.ValueMember   = "BoPhan";
            repositoryItemToThucHien.NullText      = null;
            Connect.dongketnoi();
        }
Exemplo n.º 11
0
        private void btnTongHopDoanhSo_Click(object sender, EventArgs e)
        {
            ketnoi kn = new ketnoi();

            gridControl2.DataSource = kn.laybang(@"select BanHangID,DatHangID,
                        DonHangID,MaDH,SoLuongDonHang,Dongia,
                        ThanhTien,MaSP,TenGoiNhaMay,MaSPKhachHang,TenGoiKhachHang,
                        MaPO,NgayTao,NguoiTao,NguoiHC,NgayHC from BanHang where NgayTao between '" + dptu_ngay.Value.ToString("yyyy/MM/dd") + "' and '" + dpden_ngay.Value.ToString("yyyy/MM/dd") + "'");
            kn.dongketnoi();
            gridView2.Columns["DatHangID"].GroupIndex = 0;
        }
Exemplo n.º 12
0
        private void btnTaoMoi_Click(object sender, EventArgs e)
        {
            ketnoi kn = new ketnoi();

            gridControl3.DataSource = kn.laybang(@"select top 1 DatHangID='',DonHangID='',madh='',
                Soluong='',dongia='',thanhtien='',MaSP='',Tenquicach='',Masp_KH='',
                Tenkhachhang='',MaPO='',thoigianthaydoi='',Thoigian_Thuc='' from tblDHCT");
            kn.dongketnoi();
            this.gridView3.OptionsView.NewItemRowPosition
                = DevExpress.XtraGrid.Views.Grid.NewItemRowPosition.Top;
        }
Exemplo n.º 13
0
        void DocDSCongDoan_TheoTen(string Masp)
        {
            ketnoi kn = new ketnoi();

            gridControl1.DataSource = kn.laybang(@"
               select NguyenCong,Dongia_CongDoan,NguyenCong,SoChiTiet,id,Masp,Tensp,Tencondoan,
               Dongia_CongDoan*SoChiTiet Dongia,DonGiaThuongPhanBo,
               BoPhanThucHien,TrungCongDoan from tblDMuc_LaoDong where
               Masp='" + Masp + "'");
            kn.dongketnoi();
        }
Exemplo n.º 14
0
        private void ListQuyTrinhSanPham()//Load Quy trinh
        {
            ketnoi kn = new ketnoi();

            gridControl3.DataSource = kn.laybang("select id,masoqt,ngaybanhanh,QT.masp,SP.Tensp,diengiai,tacnhan, "
                                                 + "nguoilap,ngayghi,KH.TenKH from tblQUYTRINH_SANXUAT QT "
                                                 + "left outer join tblSANPHAM SP on QT.masp=SP.Masp "
                                                 + "left outer join tblKHACHHANG KH on SP.Makh=KH.MKH where ngaybanhanh "
                                                 + " between '" + dptu_ngay.Value.ToString("yyyy/MM/dd") + "' and '" + dpden_ngay.Value.ToString("yyyy/MM/dd") + "' order by id ASC");
            kn.dongketnoi();
        }
Exemplo n.º 15
0
        private void ThongTinQADH()
        {
            ketnoi kn = new ketnoi();

            gridControl3.DataSource = kn.laybang("select Ngaytrienkhai,QC,NoidungQC,NgayQC,QA,Donvisp,IDSP,  "
                                                 + " CT.IdPSX,CT.nvkd,CT.SPLR,CT.SLSPLR,ngaytrienkhai,CT.madh,CT.LoaiDH,mabv,sanpham,Maubv, "
                                                 + " Mact, Ten_ct, So_CT, ChatlieuCT, soluongyc, tonkho, soluongsx, "
                                                 + " ngoaiquang, donvi, daystar, dayend, MaKH, CT.khachhang, xeploai, Ghichu, CT.MaPo, "
                                                 + " TrangThai, DH.Diengiai from tblchitietkehoach CT left join tblDONHANG DH on CT.madh = DH.madh where CT.madh like N'" + txtMadh.Text + "'");
            kn.dongketnoi();
        }
Exemplo n.º 16
0
        private void TaoMoiChiTiet()
        {
            ketnoi kn     = new ketnoi();
            string sqlStr = string.Format(@"select top 0 DonVi,MaLapGhep,MaChiTiet,
			 TenChiTiet,SoLuongChiTiet,
              VatLieuChiTiet,MaSanPham
			  from TempApMaChiTiet"            );

            grcChiTiet.DataSource = kn.laybang(sqlStr);
            kn.dongketnoi();
        }
Exemplo n.º 17
0
        private void BanHangThem()
        {
            ketnoi kn = new ketnoi();

            gridControl1.DataSource = kn.laybang(@"select BanHangID,DatHangID,
                        DonHangID,MaDH,SoLuongDonHang,Dongia,
                        ThanhTien,MaSP,TenGoiNhaMay,MaSPKhachHang,TenGoiKhachHang,
                        MaPO,NgayTao,NguoiTao,NguoiHC,NgayHC from BanHang where DatHangID like '" + txtDatHangID.Text + "'");
            kn.dongketnoi();
            gridView1.Columns["DatHangID"].GroupIndex = -1;
        }
Exemplo n.º 18
0
        private void ntnNew_Click(object sender, EventArgs e)
        {
            gridView1.OptionsView.NewItemRowPosition =
                DevExpress.XtraGrid.Views.Grid.NewItemRowPosition.Bottom;
            gridView1.OptionsSelection.CheckBoxSelectorColumnWidth = 20;
            ketnoi kn = new ketnoi();

            gridControl1.DataSource = kn.laybang(@"select top 0 ID,BoPhan,MaBoPhan,NguoiLap,
                NgayGhi from tblPHONGBAN_TK");
            kn.dongketnoi();
        }
Exemplo n.º 19
0
        private void DocPhuKienVatTu()
        {
            ketnoi kn     = new ketnoi();
            string sqlStr = string.Format(@"select idPSX,IDSP,sanpham,soluongsx,
                    HanDen,ToGiaoTruoc,SoHoanThanh
                    from calenderdp_dauvaohanpat_func() 
                    where Handen is not null and idPSX = '{0}'", this.donHangID);

            gridControl1.DataSource = kn.laybang(sqlStr);
            kn.dongketnoi();
        }
Exemplo n.º 20
0
        private void DocTatCa()
        {
            ketnoi kn = new ketnoi();

            gridControl2.DataSource = kn.laybang(@"SELECT ID,SanPham,TenKhuon,NgayYC
                ,ThietKeBD,ThietKeKT,PhoiBD,PhoiKT
                ,GiaCongBD,GiaCongKT,LapRapBD,LapRapKT,ThuKhuonBD
                ,ThuKhuonKT,ChinhKhuonBD,ChinhKhuonKT,NgayNghiemThu,KetQua
                ,GhiChu,NguoiGhi,NgayGhi,NguoiSua,NgaySua FROM dbo.tblCVKhuon 
                where NgayGhi between '" + dptu_ngay.Value.ToString("yyyy-MM-dd") + "' and '" + dpden_ngay.Value.ToString("yyyy-MM-dd") + "'");
            kn.dongketnoi();
        }
Exemplo n.º 21
0
        private void DocCVKhuon()
        {
            ketnoi kn = new ketnoi();

            gridControl2.DataSource = kn.laybang(@"SELECT ID,SanPham,TenKhuon,NgayYC
                ,ThietKeBD,ThietKeKT,PhoiBD,PhoiKT
                ,GiaCongBD,GiaCongKT,LapRapBD,LapRapKT,ThuKhuonBD
                ,ThuKhuonKT,ChinhKhuonBD,ChinhKhuonKT,NgayNghiemThu,KetQua
                ,GhiChu,NguoiGhi,NgayGhi,NguoiSua,NgaySua FROM dbo.tblCVKhuon 
                where ketqua is null or KetQua=''");
            kn.dongketnoi();
        }
Exemplo n.º 22
0
        private void GridlookupEditSP()//Danh mục xuất nhập tồn kho sản phẩm
        {
            ketnoi Connect = new ketnoi();

            gridLookSanPham.Properties.DataSource     = Connect.laybang("select * from tblSanpham_tonkho order by idtpnk desc");
            gridLookSanPham.Properties.DisplayMember  = "Masp";
            gridLookSanPham.Properties.ValueMember    = "Masp";
            gridLookSanPham.Properties.TextEditStyle  = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;
            gridLookSanPham.Properties.BestFitMode    = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup;
            gridLookSanPham.Properties.ImmediatePopup = true;
            Connect.dongketnoi();
        }
Exemplo n.º 23
0
        private void TheHienCauTrucSanPham()
        {
            ketnoi kn = new ketnoi();

            grSanPham.DataSource = kn.laybang(@"select c.Masp,s.Tensp,MaCum,TenCum,
                SoLuongCum,Mact,Ten_ct,Soluong_CT,''KichThuc,''GhiChu
                from tblSANPHAM_CT c
                inner join tblSANPHAM s
                on c.SanPhamID=s.Code
                where MaCum <>'' and TenCum <>''");
            kn.dongketnoi();
        }
Exemplo n.º 24
0
        void DanhSachSanPhamTheoTen(string maSanPham)
        {
            ketnoi kn = new ketnoi();

            gridControl3.DataSource = kn.laybang(@"
                select Code,S.Masp,Tensp,
                DonGiaThuong,NguoiLapDGThuong,
				NgayLapDGThuong,DonGiaThuong,L.Masp DinhMuc from tblSANPHAM S left outer join
				(select Masp from tblDMuc_LaoDong group by Masp) L
				on S.Masp=L.Masp where S.Masp='"                 + maSanPham + "' order by Code DESC");
            kn.dongketnoi();
        }
Exemplo n.º 25
0
        private void ListDMNCC() //Combobox lấy danh mục nhà cung cấp
        {
            ketnoi Connect = new ketnoi();

            cbNCC.Properties.DataSource     = Connect.laybang("select * from tblDM_NCC_VATTU order by Ngaycapnhat_NCC desc ");
            cbNCC.Properties.DisplayMember  = "Ten_NCC";
            cbNCC.Properties.ValueMember    = "Ten_NCC";
            cbNCC.Properties.TextEditStyle  = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;
            cbNCC.Properties.BestFitMode    = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup;
            cbNCC.Properties.ImmediatePopup = true;
            Connect.dongketnoi();
        }
Exemplo n.º 26
0
        private void ListAllQA(object sender, EventArgs e)
        {
            ketnoi kn = new ketnoi();

            gridControl3.DataSource = kn.laybang("select CT.madh+CT.mabv as IdGroup,Ngaytrienkhai,QC,NoidungQC,NgayQC,QA,Donvisp,IDSP,CT.IdPSX,CT.nvkd,CT.SPLR,CT.SLSPLR,ngaytrienkhai,CT.madh,CT.LoaiDH,mabv,sanpham,Maubv, "
                                                 + " Mact, Ten_ct, So_CT, ChatlieuCT, soluongyc, tonkho, soluongsx, "
                                                 + " ngoaiquang, donvi, daystar, dayend, MaKH, CT.khachhang, xeploai, Ghichu, CT.MaPo, "
                                                 + " TrangThai, DH.Diengiai from tblchitietkehoach CT left join tblDONHANG DH on CT.madh = DH.madh   where CT.ngaytrienkhai  "
                                                 + " between '" + dptu_ngay.Value.ToString("yyyy/MM/dd") + "' and '" + dpden_ngay.Value.ToString("yyyy/MM/dd") + "' order by CT.ngaytrienkhai DESC");
            kn.dongketnoi();
            gridView3.ExpandAllGroups();
        }
Exemplo n.º 27
0
        void DocDSDonHangXuat_TheoNgay()
        {
            ketnoi kn = new ketnoi();

            gridControl2.DataSource = kn.laybang(@"select T.*,P.DonGiaThuong DaCoGia from
                (select min(MaGH)MaGH,cast(min(ngaynhan)as date)ngaynhan,madh,mabv,max(chitietsanpham)sanpham,
                max(soluongsx)soluongsx,
                sum(BTPT11)BTPT11,sum(BTPT11*DonGiaThuong)TienThuongXuatKho,max(DonGiaThuong)DonGiaThuong
                from tbl11 where madh !='' and mabv <>'' group by madh,mabv)T
				left outer join tblSANPHAM P on T.mabv=P.Masp where cast(ngaynhan as date) between '"                 + dptu_ngay.Value.ToString("MM/dd/yyyy") + "' and '" + dpden_ngay.Value.ToString("MM/dd/yyyy") + "'");
            kn.dongketnoi();
        }
Exemplo n.º 28
0
        private void BtnList_CongDoan_Click(object sender, EventArgs e)
        {
            ketnoi kn = new ketnoi();

            gridControl1.DataSource = kn.laybang(@"select 
                id,Ngayghi,LD.Masp,LD.Tensp,Macongdoan,Tencondoan,Dinhmuc,
                Dongia_CongDoan,Tothuchien,Nguoilap,LD.Ngaylap,Trangthai,LD.DonGia_ApDung,
                LD.NgayApDung from tblDMuc_LaoDong LD left outer join tblSANPHAM SP
				on LD.Masp=SP.Masp"                );
            kn.dongketnoi();
            gridView1.ExpandAllGroups();
        }
Exemplo n.º 29
0
        private void LOAD_PRINT_PHIEUGH()
        {
            DataTable dt = new DataTable();
            ketnoi    kn = new ketnoi();

            dt = kn.laybang("select * from tblHanBam where MaGH  like N'" + txtMagiaohang.Text + "'");
            XRPGH_NOIBO XtrGIAOHANG = new XRPGH_NOIBO();

            XtrGIAOHANG.DataSource = dt;
            XtrGIAOHANG.DataMember = "Table";
            XtrGIAOHANG.ShowPreviewDialog(); kn.dongketnoi();
        }
Exemplo n.º 30
0
        void DocTatCaDSDonHangXuat()
        {
            ketnoi kn = new ketnoi();

            gridControl2.DataSource = kn.laybang(@"select T.*,P.DonGiaThuong DaCoGia from
                (select min(MaGH)MaGH,cast(min(ngaynhan)as date)ngaynhan,madh,mabv,max(chitietsanpham)sanpham,
                max(soluongsx)soluongsx,
                sum(BTPT11)BTPT11,sum(BTPT11*DonGiaThuong)TienThuongXuatKho,max(DonGiaThuong)DonGiaThuong
                from tbl11 where madh !='' and mabv <>'' group by madh,mabv)T
				left outer join tblSANPHAM P on T.mabv=P.Masp"                );
            kn.dongketnoi();
        }