Ejemplo n.º 1
0
        private void GlEditDanhMucCP()//Danh muc ky chi phi
        {
            ketnoi Connect = new ketnoi();

            glMasp.Properties.DataSource     = Connect.laybang("select id_z,masp,tenloai,Macp from tblz_dmchiphi");
            glMasp.Properties.DisplayMember  = "id_z";
            glMasp.Properties.ValueMember    = "id_z";
            glMasp.Properties.TextEditStyle  = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;
            glMasp.Properties.BestFitMode    = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup;
            glMasp.Properties.ImmediatePopup = true;
            Connect.dongketnoi();
        }
Ejemplo n.º 2
0
        private void GridLookupTonKho()//Danh mục hàng tồn trong kho
        {
            ketnoi Connect = new ketnoi();

            gridLookUpEditVatTu.Properties.DataSource     = Connect.laybang("select * from tblDM_VATLIEUPHU");
            gridLookUpEditVatTu.Properties.DisplayMember  = "Mavlphu";
            gridLookUpEditVatTu.Properties.ValueMember    = "Mavlphu";
            gridLookUpEditVatTu.Properties.TextEditStyle  = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;
            gridLookUpEditVatTu.Properties.BestFitMode    = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup;
            gridLookUpEditVatTu.Properties.ImmediatePopup = true;
            Connect.dongketnoi();
        }
Ejemplo n.º 3
0
        private void List_TienDoTong()
        {
            ketnoi kn = new ketnoi();

            gridControl2.DataSource = kn.laybang(@"select idsp,madh,mabv,sanpham,Ten_ct,soluongyc,tonkho,soluongsx, 
                isnull(BTPT16,0)-isnull(soluongsx,0) as CONLAI,donvi,ngoaiquang,ngaytrienkhai,dayend, 
                 BTPT1,BTPT2,BTPT3,BTPT4,BTPT5,BTPT6,BTPT7,BTPT8,BTPT9,BTPT10, 
                 BTPT11,BTPT12,BTPT13,BTPT14,BTPT15,BTPT16,BTPT17,BTPT18,BTPT19,BTPT20,BTPT21 
                 from tblchitietkehoach where ngaytrienkhai 
                 between '" + dptu_ngay.Value.ToString("yyyy/MM/dd") + "' and '" + dpden_ngay.Value.ToString("yyyy/MM/dd") + "'");
            kn.dongketnoi();
        }
Ejemplo n.º 4
0
        private void gridlookupPSX()//gridlookup vật tư sử dụng
        {
            ketnoi Connect = new ketnoi();

            gridLookMavattu.Properties.DataSource     = Connect.laybang("select * from tblDM_VATTU order by Ngaylap desc");
            gridLookMavattu.Properties.DisplayMember  = "Ma_vl";
            gridLookMavattu.Properties.ValueMember    = "Ma_vl";
            gridLookMavattu.Properties.TextEditStyle  = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;
            gridLookMavattu.Properties.BestFitMode    = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup;
            gridLookMavattu.Properties.ImmediatePopup = true;
            Connect.dongketnoi();
        }
Ejemplo n.º 5
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();
        }
Ejemplo n.º 6
0
        private void LOAD_PRINT_PHIEUGH()
        {
            DataTable dt = new DataTable();
            ketnoi    kn = new ketnoi();

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

            XtrGIAOHANG.DataSource = dt;
            XtrGIAOHANG.DataMember = "Table";
            XtrGIAOHANG.ShowPreviewDialog(); kn.dongketnoi();
        }
Ejemplo n.º 7
0
        private void BaoCaoChiPhiNhanVien()
        {
            ketnoi kn = new ketnoi();

            gridControl5.DataSource = kn.laybang(@"SELECT NhanVienID,HoTen,Sothe,ChiPhiNhanVien,NoiDungViPham,SBB,SoNcr,
                KhongPhuHop,HinhThucXuLy FROM tblNCR R
                INNER JOIN NcrNhanVien N
                ON R.NcrID=N.NcrID where 
                NgayLap between '" + dpChiPhiNhanVienTu.Value.ToString("MM/dd/yyyy") + "' and '" + dpChiPhiNhanVienDen.Value.ToString("MM/dd/yyyy") + "'");
            kn.dongketnoi();
            gridView6.ExpandAllGroups();
        }
Ejemplo n.º 8
0
        private void DocDanhSachDinhMuc()
        {
            ketnoi kn = new ketnoi();

            gridControl1.DataSource = kn.laybang(@"select id,Masp,Tensp,Macongdoan,
            Tencondoan,Dinhmuc,Macv,HeSoDinhMuc, NguyenCong,
            Dongia_CongDoan, NguoiHC_CV, NgayHC_CV
            from tblDMuc_LaoDong");
            kn.dongketnoi();
            gridView1.Columns["Tensp"].GroupIndex = 0;
            gridView1.ExpandAllGroups();
        }
Ejemplo n.º 9
0
        private void DocNCRMoi()
        {
            ketnoi kn = new ketnoi();

            gridControl2.DataSource = kn.laybang(@"select Top 0 cast(NgayLap as date)NgayLap,SoNcr='',SBB='',
                        KhongPhuHop='',NguyenNhan='',KhacPhuc='',PhongNgua='',
						CaiTien='',KetQua='',GhiChu='',SoNcr='',NguoiLap='',HinhThucXuLy='',
                        cast(NgayPhaiHoanThanh as date) NgayPhaiHoanThanh,
                        cast(NgayGiamSat as date) NgayGiamSat,ThoaMan='',
                        KhongThoaMan='',NcrMoi='' from tblNCR");
            kn.dongketnoi();
        }
Ejemplo n.º 10
0
        private void DocChiPhiNhanVien()
        {
            ketnoi kn = new ketnoi();

            gridControl4.DataSource = kn.laybang(@"select NcrNhanVienID,
                        Sothe,HoTen,NcrID,NhanVienID ID,
                        ChiPhiNhanVien,NoiDungViPham 
                        from NcrNhanVien where NcrID = " + txtNcrID.Text + "");
            kn.dongketnoi();
            this.gridView4.OptionsSelection.MultiSelectMode
                = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CheckBoxRowSelect;
        }
Ejemplo n.º 11
0
        private void list_nhatky()//Danh sách z khởi tạo trọng tháng
        {
            ketnoi kn = new ketnoi();

            gridControl2.DataSource = kn.laybang("select nk.*,dt.Maz,dt.z_tong,kb.tenz,dt.dm_vlchinh,dt.dm_vlphu,kb.masp,kh.tenkh, "
                                                 + " dt.dm_nctt,dt.cp_sxchung,dt.cp_bhang,dt.cp_quanly,dt.cp_khuon,kygia "
                                                 + " from tblz_nhatky nk left outer join   "
                                                 + " tblz_doitongtaphopchiphi dt on nk.idKygia=dt.id left outer join "
                                                 + " tblz_khaibao kb on dt.Maz=kb.maz left outer join tblz_khachhang kh on nk.id_khach=kh.makh where convert(date,nk.ngaylap,101) between '" + dptu_ngay.Value.ToString("yyyy/MM/dd") + "' "
                                                 + " and '" + dpden_ngay.Value.ToString("yyyy/MM/dd") + "'");
            kn.dongketnoi();
        }
Ejemplo n.º 12
0
        private void GlEdiKhachHang()//Danh mục đối tượng tính z
        {
            ketnoi Connect = new ketnoi();

            cbMakhachhang.Properties.DataSource     = Connect.laybang("select * from tblz_khachhang");
            cbMakhachhang.Properties.DisplayMember  = "makh";
            cbMakhachhang.Properties.ValueMember    = "makh";
            cbMakhachhang.Properties.TextEditStyle  = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;
            cbMakhachhang.Properties.BestFitMode    = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup;
            cbMakhachhang.Properties.ImmediatePopup = true;
            Connect.dongketnoi();
        }
Ejemplo n.º 13
0
        private void DocChiTietCungLoaiTam()
        {
            ketnoi kn     = new ketnoi();
            string sqlStr = string.Format(@"select ''DonVi,''MaLapGhep,MaChiTiet,
			 TenChiTiet,SoLuongChiTiet,
              VatLieuChiTiet,MaSanPham
			  from TempApMaChiTiet"            ,
                                          grlSanPham.Text);

            grcChiTiet.DataSource = kn.laybang(sqlStr);
            kn.dongketnoi();
        }
Ejemplo n.º 14
0
        private void LOOUP_SANPHAM()//LooupEdit mã sản phẩm từ đặc điểm khuôn
        {
            DataTable Table   = new DataTable();
            ketnoi    Connect = new ketnoi();

            LookupCheck_Masp.Properties.DataSource     = Connect.laybang("select Masp,Ma_khuon,Ten_khuon,Dacdiem_khuon from tblDM_KHUON where Dacdiem_khuon like N'" + txtDacdiem_khuon.Text + "'");
            LookupCheck_Masp.Properties.DisplayMember  = "Masp";
            LookupCheck_Masp.Properties.ValueMember    = "Masp";
            LookupCheck_Masp.Properties.TextEditStyle  = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;
            LookupCheck_Masp.Properties.BestFitMode    = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup;
            LookupCheck_Masp.Properties.ImmediatePopup = true;
        }
Ejemplo n.º 15
0
        private void TheHienToThucHien()
        {
            repositoryItemComboBox1.Items.Clear();
            ketnoi kn = new ketnoi();
            var    dt = kn.laybang(@"select ToThucHien from tblResources");

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                repositoryItemComboBox1.Items.Add(dt.Rows[i]["ToThucHien"]);
            }
            kn.dongketnoi();
        }
Ejemplo n.º 16
0
        private void btnPrintBaoCaoTre_Click(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();
            ketnoi    kn = new ketnoi();

            dt = kn.laybang(@"select * from viewDonHangTre where IDSP like '" + txtIDSP.Text + "'");
            RpDonHangTre rpDonHangTre = new RpDonHangTre();

            rpDonHangTre.DataSource = dt;
            rpDonHangTre.DataMember = "Table";
            rpDonHangTre.ShowPreviewDialog();
        }
Ejemplo n.º 17
0
        private void BtnXuatPhieu_Click(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();
            ketnoi    kn = new ketnoi();

            dt = kn.laybang("select * from ViewXuatKho_Gia where MaGH like N'" + txtMaphieu.Text + "' ");
            XRGIAXUAT XRXUATKHO_GIA = new XRGIAXUAT();

            XRXUATKHO_GIA.DataSource = dt;
            XRXUATKHO_GIA.DataMember = "Table";
            XRXUATKHO_GIA.ShowPreviewDialog();
        }
Ejemplo n.º 18
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();
        }
Ejemplo n.º 19
0
        private void btnDocDonHangTre_Click(object sender, EventArgs e)
        {
            ketnoi kn = new ketnoi();

            gridControl1.DataSource = kn.laybang(@"SELECT IdPSX,IDSP,DanhGia,mabv,madh,SPLR,sanpham,soluongyc,BTPT11,
                KetThucTo11,AllProgress,STATUS,ngoaiquang
                FROM PHANTICH_CHUNG WHERE STATUS =N'Trễ' or STATUS =N'Đỏ'");
            kn.dongketnoi();
            this.gridView1.OptionsSelection.MultiSelectMode
                = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.RowSelect;
            this.gridView1.Appearance.Row.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;
        }
        private void GlDMGianguyenlieu()//Danh mục định mức giá vật liệu sử dụng
        {
            ketnoi Connect = new ketnoi();

            glMavatlieu.Properties.DataSource     = Connect.laybang("select * from tblz_danhmucgiavatlieu");
            glMavatlieu.Properties.DisplayMember  = "Madongiavl";
            glMavatlieu.Properties.ValueMember    = "Madongiavl";
            glMavatlieu.Properties.TextEditStyle  = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;
            glMavatlieu.Properties.BestFitMode    = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup;
            glMavatlieu.Properties.ImmediatePopup = true;
            Connect.dongketnoi();
        }
Ejemplo n.º 21
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();
        }
Ejemplo n.º 22
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();
        }
Ejemplo n.º 23
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();
        }
Ejemplo n.º 24
0
        public void LoadDataVattu()
        {
            ketnoi kn = new ketnoi();

            gridControl1.DataSource = kn.laybang("SELECT CodeVatllieu,Iden,madh,Codedetail "
                                                 + ", Tenquicachsp, Soluongsanpham, Donvi_sanpham, Ten_vattu "
                                                 + ", SL_vattucan, KL_vattucan, SL_vattutonkho, KL_vattutonkho, SL_vattumua, KL_vattumua "
                                                 + ", Donvi_vattu, NCC, NguoiGD, Dongia, Donviquydoi, Ngaydat_vattu, NgayDK_ve, Ngayve_TT, "
                                                 + "SL_vattuve, KL_vattuve, SL_tinhgia, Dvt_gia, Ghichu_dathangmua, Ghichu_denghimua, "
                                                 + "DK_TCmua, VAT, quyetdinh, nhanviendathang, nguoikiemkho, ngaykiemkho, nguoinhap, ngaynhap "
                                                 + " FROM dbo.tblvattu_dauvao");
        }
Ejemplo n.º 25
0
        private void LOAD_TRE()
        {
            ketnoi kn = new ketnoi();

            gridControl1.DataSource = kn.laybang(@"select PT.*,VT.Thucnhap,VT.Ngaynhap,Ten_vattu from 
            (select madh+mabv Ma_PT,* from PHANTICH_TIENDO07) PT
            left outer join
            (select Madh+Masp Ma_VT,Thucnhap,Ngaynhap,Ten_vattu from PHANTICH_TIENDOVATTU) VT
            on PT.Ma_PT=VT.Ma_VT
            where Ma_PT is not null and Ma_VT is not null and PT.STATUS <> 'HOAN THANH'");
            gridView1.ExpandAllGroups();
        }
Ejemplo n.º 26
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();
        }
Ejemplo n.º 27
0
        private void LookupGrid()
        {
            ketnoi    kn = new ketnoi();
            DataTable dt = new DataTable();

            dt = kn.laybang("select Ma_Nguonluc,Ten_Nguonluc from tblResources");
            List <tblDelivery_Dtl> details = new List <tblDelivery_Dtl>();

            details = Utils.ConvertDataTable <tblDelivery_Dtl>(dt);
            gridControl2.DataSource = new BindingList <tblDelivery_Dtl>(details);
            gridControl2.DataSource = dt;
            kn.dongketnoi();
        }
Ejemplo n.º 28
0
        private void DocDSSanPham()
        {
            ketnoi kn = new ketnoi();

            grcSanPham.DataSource = kn.laybang(@"select case when m.MaSanPham is not null
                then 'x' end DaApMa,Code,Masp,Tensp,
                Hotennv,Ngaylap
                from tblSANPHAM s
				left outer join
				(select MaSanPham from SanPhamKhuon group by MaSanPham)m
				on s.Masp=m.MaSanPham order by Ngaylap Desc"                );
            kn.dongketnoi();
        }
Ejemplo n.º 29
0
        private void LOAD_TIME()
        {
            ketnoi kn = new ketnoi();

            gridControl1.DataSource = kn.laybang(@"select PT.*,VT.Thucnhap,VT.Ngaynhap,Ten_vattu from 
            (select madh+mabv Ma_PT,* from PHANTICH_TIENDO07) PT
            left outer join
            (select Madh+Masp Ma_VT,Thucnhap,Ngaynhap,Ten_vattu from PHANTICH_TIENDOVATTU) VT
            on PT.Ma_PT=VT.Ma_VT
            where Ma_PT is not null and Ma_VT is not null and convert(Date,PT.ngaytrienkhai,103) between '" + dptu_ngay.Value.ToString("yyyy/MM/dd") + "' and '" + dpden_ngay.Value.ToString("yyyy/MM/dd") + "'");
            kn.dongketnoi();
            gridView1.ExpandAllGroups();
        }
Ejemplo n.º 30
0
        private void txtidentitysanpham_TextChanged(object sender, EventArgs e)//BẮT SỰ IỆN THAY ĐỔI SỐ TEXT IDEN SẢN PHẨM VIEW VẬT LIỆU CHI TIẾT
        {
            ketnoi kn = new ketnoi();

            gridControl1.DataSource = kn.laybang("SELECT Donviquydoi,CodeVatllieu,Iden,madh,Codedetail "
                                                 + ", Tenquicachsp, Soluongsanpham, Donvi_sanpham, Ten_vattu "
                                                 + ", SL_vattucan, KL_vattucan, SL_vattutonkho, KL_vattutonkho, SL_vattumua, KL_vattumua "
                                                 + ", Donvi_vattu, NCC, NguoiGD, Dongia, Donviquydoi, Ngaydat_vattu, NgayDK_ve, Ngayve_TT, "
                                                 + "SL_vattuve, KL_vattuve, SL_tinhgia, Dvt_gia, Ghichu_dathangmua, Ghichu_denghimua, "
                                                 + "DK_TCmua, VAT, quyetdinh, nhanviendathang, nguoikiemkho, ngaykiemkho, nguoinhap, ngaynhap,fax,NVKD,Kiemkho "
                                                 + " FROM dbo.tblvattu_dauvao where Iden like '" + txtIden.Text + "'");
            kn.dongketnoi();
        }