private void hiendonhang_CheckedChanged(object sender, EventArgs e) { if (hiendonhang.Checked == true) { btnXacNhan.Enabled = false; var db = new MyDBContextDataContext(); var lst = (from s in db.DonSanXuat_QuanLyDonhang_View() where s.BoPhan == danhthiep select s).ToList(); foreach (var item in lst) { if (item.NghiepVu_XuongDon != null) { item.NghiepVu_XuongDon = "True"; _nghiepvuCheck.ValueChecked = "True"; } if (item.CtpNhan != null) { item.CtpNhan = "True"; CtpNhanCheck.ValueChecked = "True"; } if (item.CtpHoanThanh != null) { item.CtpHoanThanh = "True"; CtpHoanthanhCheck.ValueChecked = "True"; } if (item.DanhThiepNhan != null) { item.DanhThiepNhan = "True"; DanhthiepNhanCheck.ValueChecked = "True"; } if (item.DanhThiepHoanThanh != null) { item.DanhThiepHoanThanh = "True"; DanhthiepHoanthanhCheck.ValueChecked = "True"; } if (item.SauInNhan != null) { item.SauInNhan = "True"; SauinNhanCheck.ValueChecked = "True"; } if (item.SauInHoanThanh != null) { item.SauInHoanThanh = "True"; SauinHoanthanhCheck.ValueChecked = "True"; } if (item.HoanThanh != null) { item.HoanThanh = "True"; SanxuatHoanThanhCheck.ValueChecked = "True"; } } procQuanLyDonhang_ViewGridControl.DataSource = lst; } else { frmDanhThiep_Load(sender, e); btnXacNhan.Enabled = true; } }
private void hiendonhang_CheckedChanged(object sender, EventArgs e) { if (hiendonhang.Checked == true) { btnXacNhan.Enabled = false; var db = new MyDBContextDataContext(); var lst = (from s in db.DonSanXuat_QuanLyDonhang_View() where s.BoPhan == temvai && s.NghiepVu_XuongDon != null select s).ToList(); foreach (var item in lst) { if (item.NghiepVu_XuongDon != null) { item.NghiepVu_XuongDon = "True"; NghiepvuCheck.ValueChecked = "True"; } if (item.CtfNhan != null) { item.CtfNhan = "True"; CtfNhanCheck.ValueChecked = "True"; } if (item.CtfHoanThanh != null) { item.CtfHoanThanh = "True"; CtfHoanThanhCheck.ValueChecked = "True"; } if (item.TemVaiNhan != null) { item.TemVaiNhan = "True"; TemvaiNhanCheck.ValueChecked = "True"; } if (item.TemVaiHoanThanh != null) { item.TemVaiHoanThanh = "True"; TemvaiHoanthanhCheck.ValueChecked = "True"; } if (item.KhoBTPNhan != null) { item.KhoBTPNhan = "True"; KhoNhanCheck.ValueChecked = "True"; } if (item.KhoBTPHoanThanh != null) { item.KhoBTPHoanThanh = "True"; KhoHoanthanhCheck.ValueChecked = "True"; } if (item.HoanThanh != null) { item.HoanThanh = "True"; SanxuatHoanThanhCheck.ValueChecked = "True"; } } procQuanLyDonhang_ViewGridControl.DataSource = lst; } else { frmTemVai_Load(sender, e); btnXacNhan.Enabled = true; } }
private void Check() { var db = new MyDBContextDataContext(); var lst = (from s in db.DonSanXuat_QuanLyDonhang_View() where s.DanhThiepHoanThanh == null && s.BoPhan == danhthiep && s.NghiepVu_XuongDon != null select s).ToList(); //var lst = (from s in db.tbQuanLyDonHangs join x in db.tbDonSanXuats on s.IDQuanLyDonHang equals x.SCD select s).ToList(); foreach (var item in lst) { if (item.NghiepVu_XuongDon != null) { item.NghiepVu_XuongDon = "True"; _nghiepvuCheck.ValueChecked = "True"; } if (item.CtpNhan != null) { item.CtpNhan = "True"; CtpNhanCheck.ValueChecked = "True"; } if (item.CtpHoanThanh != null) { item.CtpHoanThanh = "True"; CtpHoanthanhCheck.ValueChecked = "True"; } if (item.DanhThiepNhan != null) { item.DanhThiepNhan = "True"; DanhthiepNhanCheck.ValueChecked = "True"; } if (item.DanhThiepHoanThanh != null) { item.DanhThiepHoanThanh = "True"; DanhthiepHoanthanhCheck.ValueChecked = "True"; } if (item.KiemPhamNhan != null) { item.KiemPhamNhan = "True"; KiemphamNhanCheck.ValueChecked = "True"; } if (item.SauInNhan != null) { item.SauInNhan = "True"; SauinNhanCheck.ValueChecked = "True"; } if (item.SauInHoanThanh != null) { item.SauInHoanThanh = "True"; SauinHoanthanhCheck.ValueChecked = "True"; } if (item.HoanThanh != null) { item.HoanThanh = "True"; SanxuatHoanThanhCheck.ValueChecked = "True"; } } procQuanLyDonhang_ViewGridControl.DataSource = lst; }
private void procQuanLyDonhang_ViewGridControl_Click(object sender, EventArgs e) { databinding(); var db = new MyDBContextDataContext(); var lst = (from s in db.DonSanXuat_QuanLyDonhang_View() where s.IDQuanLyDonHang == sCDTextEdit.Text select s).Single(); xacnhan.Text = lst.CtfNhan; hoanthanh.Text = lst.CtfHoanThanh; }
public void check() { var db = new MyDBContextDataContext(); var lst = (from s in db.DonSanXuat_QuanLyDonhang_View() where s.TemVaiHoanThanh == null && s.NghiepVu_XuongDon != null && s.BoPhan == temvai select s).ToList(); //var lst = (from s in db.tbQuanLyDonHangs join x in db.tbDonSanXuats on s.IDQuanLyDonHang equals x.SCD select s).ToList(); foreach (var item in lst) { if (item.NghiepVu_XuongDon != null) { item.NghiepVu_XuongDon = "True"; NghiepvuCheck.ValueChecked = "True"; } if (item.CtfNhan != null) { item.CtfNhan = "True"; CtfNhanCheck.ValueChecked = "True"; } if (item.CtfHoanThanh != null) { item.CtfHoanThanh = "True"; CtfHoanThanhCheck.ValueChecked = "True"; } if (item.TemVaiNhan != null) { item.TemVaiNhan = "True"; TemvaiNhanCheck.ValueChecked = "True"; } if (item.TemVaiHoanThanh != null) { item.TemVaiHoanThanh = "True"; TemvaiHoanthanhCheck.ValueChecked = "True"; } if (item.KhoBTPNhan != null) { item.KhoBTPNhan = "True"; KhoNhanCheck.ValueChecked = "True"; } if (item.KhoBTPHoanThanh != null) { item.KhoBTPHoanThanh = "True"; KhoHoanthanhCheck.ValueChecked = "True"; } if (item.HoanThanh != null) { item.HoanThanh = "True"; SanxuatHoanThanhCheck.ValueChecked = "True"; } } procQuanLyDonhang_ViewGridControl.DataSource = lst; }
private void hiendonhang_CheckedChanged(object sender, EventArgs e) { if (hiendonhang.Checked) { var db = new MyDBContextDataContext(); var lst = (from s in db.DonSanXuat_QuanLyDonhang_View() select s).ToList(); gcDonSanXuat.DataSource = lst; sCDLabel1.DataBindings.Clear(); sCDLabel1.DataBindings.Add("text", lst, "SCD"); } else { frmDonSanXuat_Load(sender, e); } }
//where s.SauInHoanThanh == null && s.BoPhan == "SAU IN" || s.BoPhan == "OFFSET" || s.BoPhan == "KỸ THUẬT SỐ" public void check() { var db = new MyDBContextDataContext(); var lst = (from s in db.DonSanXuat_QuanLyDonhang_View() where s.NghiepVu_XuongDon != null && s.KhoBTPHoanThanh == null select s).ToList(); foreach (var item in lst) { if (item.NghiepVu_XuongDon != null) { item.NghiepVu_XuongDon = "True"; NghiepvuCheck.ValueChecked = "True"; } if (item.KiemPhamHoanThanh != null) { item.KiemPhamHoanThanh = "True"; KiemphamHoanthanhCheck.ValueChecked = "True"; } if (item.KiemPhamNhan != null) { item.KiemPhamNhan = "True"; KiemphamNhanCheck.ValueChecked = "True"; } if (item.KhoBTPNhan != null) { item.KhoBTPNhan = "True"; KhoNhanCheck.ValueChecked = "True"; } if (item.KhoBTPHoanThanh != null) { item.KhoBTPHoanThanh = "True"; KhoHoanthanhCheck.ValueChecked = "True"; } if (item.HoanThanh != null) { item.HoanThanh = "True"; SanxuatHoanThanhCheck.ValueChecked = "True"; } } procQuanLyDonhang_ViewGridControl.DataSource = lst; }
public void check() { var db = new MyDBContextDataContext(); var lst = (from s in db.DonSanXuat_QuanLyDonhang_View() where s.OffsetHoanThanh == null && s.NghiepVu_XuongDon != null && s.BoPhan == PrintRibbon.offset select s).ToList(); foreach (var item in lst) { if (item.NghiepVu_XuongDon != null) { item.NghiepVu_XuongDon = "True"; NghiepvuCheck.ValueChecked = "True"; } if (item.OffsetNhan != null) { item.OffsetNhan = "True"; OffsetNhanCheck.ValueChecked = "True"; } if (item.OffsetHoanThanh != null) { item.OffsetHoanThanh = "True"; OffsetHoanthanhCheck.ValueChecked = "True"; } if (item.CtpHoanThanh != null) { item.CtpHoanThanh = "True"; CtpHoanthanhCheck.ValueChecked = "True"; } if (item.SauInNhan != null) { item.SauInNhan = "True"; SauinNhanCheck.ValueChecked = "True"; } if (item.HoanThanh != null) { item.HoanThanh = "True"; SanxuatHoanThanhCheck.ValueChecked = "True"; } } procQuanLyDonhang_ViewGridControl.DataSource = lst; }
private void hiendonhang_CheckedChanged(object sender, EventArgs e) { if (hiendonhang.Checked) { btnXacNhan.Enabled = false; MyDBContextDataContext db = new MyDBContextDataContext(); var lst = (from s in db.DonSanXuat_QuanLyDonhang_View() where s.NghiepVu_XuongDon != null && (s.BoPhan == temvai || s.BoPhan == sticker) && s.CtfHoanThanh == null select s).ToList(); foreach (var item in lst) { if (item.NghiepVu_XuongDon != null) { item.NghiepVu_XuongDon = "True"; _nghiepvuCheck.ValueChecked = "True"; } if (item.ThietKeNhan != null) { item.ThietKeNhan = "True"; thietkenhancheck.ValueChecked = "True"; } if (item.ThietKeHoanThanh != null) { item.ThietKeHoanThanh = "True"; thietkehtcheck.ValueChecked = "True"; } if (item.CtfNhan != null) { item.CtfNhan = "True"; CtfNhanCheck.ValueChecked = "True"; } if (item.CtfHoanThanh != null) { item.CtfHoanThanh = "True"; CtfHoanThanhCheck.ValueChecked = "True"; } if (item.StickerNhan != null) { item.StickerNhan = "True"; StickerNhanCheck.ValueChecked = "True"; } if (item.StickerHoanThanh != null) { item.StickerHoanThanh = "True"; StickerHoanthanhCheck.ValueChecked = "True"; } if (item.TemVaiNhan != null) { item.TemVaiNhan = "True"; TemvaiNhanCheck.ValueChecked = "True"; } if (item.TemVaiHoanThanh != null) { item.TemVaiHoanThanh = "True"; TemvaiHoanthanhCheck.ValueChecked = "True"; } if (item.HoanThanh != null) { item.HoanThanh = "True"; SanxuatHoanThanhCheck.ValueChecked = "True"; } } procQuanLyDonhang_ViewGridControl.DataSource = lst; } else { frmCTF_Load(sender, e); btnXacNhan.Enabled = true; } }
private void hiendonhang_CheckedChanged(object sender, EventArgs e) { if (hiendonhang.Checked == true) { var db = new MyDBContextDataContext(); var lst = (from s in db.DonSanXuat_QuanLyDonhang_View() where s.NghiepVu_XuongDon != null select s).ToList(); //var lst = (from s in db.tbQuanLyDonHangs join x in db.tbDonSanXuats on s.IDQuanLyDonHang equals x.SCD select s).ToList(); foreach (var item in lst) { if (item.NghiepVu_XuongDon != null) { item.NghiepVu_XuongDon = "True"; NghiepvuCheck.ValueChecked = "True"; } if (item.ThietKeNhan != null) { item.ThietKeNhan = "True"; thietkenhancheck.ValueChecked = "True"; } if (item.ThietKeHoanThanh != null) { item.ThietKeHoanThanh = "True"; thietkehtcheck.ValueChecked = "True"; } if (item.CtpNhan != null) { item.CtpNhan = "True"; CtpNhanCheck.ValueChecked = "True"; } if (item.CtpHoanThanh != null) { item.CtpHoanThanh = "True"; CtpHoanthanhCheck.ValueChecked = "True"; } if (item.CtfNhan != null) { item.CtfNhan = "True"; CtfNhanCheck.ValueChecked = "True"; } if (item.CtfHoanThanh != null) { item.CtfHoanThanh = "True"; CtfHoanthanhCheck.ValueChecked = "True"; } if (item.OffsetNhan != null) { item.OffsetNhan = "True"; OffsetNhanCheck.ValueChecked = "True"; } if (item.OffsetHoanThanh != null) { item.OffsetHoanThanh = "True"; OffsetHoanthanhCheck.ValueChecked = "True"; } if (item.KyThuatSoNhan != null) { item.KyThuatSoNhan = "True"; KtsNhanCheck.ValueChecked = "True"; } if (item.KyThuatSoHoanThanh != null) { item.KyThuatSoHoanThanh = "True"; KtsHoanthanhCheck.ValueChecked = "True"; } if (item.DanhThiepNhan != null) { item.DanhThiepNhan = "True"; DanhthiepNhanCheck.ValueChecked = "True"; } if (item.DanhThiepHoanThanh != null) { item.DanhThiepHoanThanh = "True"; DanhthiepHoanthanhCheck.ValueChecked = "True"; } if (item.StickerNhan != null) { item.StickerNhan = "True"; StickerNhanCheck.ValueChecked = "True"; } if (item.StickerHoanThanh != null) { item.StickerHoanThanh = "True"; StickerHoanthanhCheck.ValueChecked = "True"; } if (item.TemVaiNhan != null) { item.TemVaiNhan = "True"; TemvaiNhanCheck.ValueChecked = "True"; } if (item.TemVaiHoanThanh != null) { item.TemVaiHoanThanh = "True"; TemvaiHoanthanhCheck.ValueChecked = "True"; } if (item.InChuNhan != null) { item.InChuNhan = "True"; InchuNhanCheck.ValueChecked = "True"; } if (item.InChuHoanThanh != null) { item.InChuHoanThanh = "True"; InchuHoanThanhCheck.ValueChecked = "True"; } if (item.KiemPhamNhan != null) { item.KiemPhamNhan = "True"; KiemphamNhanCheck.ValueChecked = "True"; } if (item.KiemPhamHoanThanh != null) { item.KiemPhamHoanThanh = "True"; KiemphamHoanthanhCheck.ValueChecked = "True"; } if (item.KhoBTPNhan != null) { item.KhoBTPNhan = "True"; KhoNhanCheck.ValueChecked = "True"; } if (item.KhoBTPHoanThanh != null) { item.KhoBTPHoanThanh = "True"; KhoHoanthanhCheck.ValueChecked = "True"; } if (item.SauInNhan != null) { item.SauInNhan = "True"; SauinNhanCheck.ValueChecked = "True"; } if (item.SauInHoanThanh != null) { item.SauInHoanThanh = "True"; SauinHoanthanhCheck.ValueChecked = "True"; } if (item.HoanThanh != null) { item.HoanThanh = "True"; SanxuatHoanThanhCheck.ValueChecked = "True"; } } procQuanLyDonhang_ViewGridControl.DataSource = lst; } else { frmSanXuat_Load(sender, e); } //if (hiendonhang.Checked == true) //{ // bandedGridView1.Columns.Clear(); // btnXacNhan.Enabled = false; // MyDBContextDataContext db = new MyDBContextDataContext(); // var lst = (from s in db.DonSanXuat_QuanLyDonhang_View() // select new // { // s.SCD,s.MaDonHang,s.TenKhachHang,s.TenSanPham,s.SoLuong,s.NgayXuongDon,s.NgayGiaoHang,s.NghiepVu_XuongDon,s.ThietKeNhan,s.ThietKeHoanThanh // }).ToList(); // procQuanLyDonhang_ViewGridControl.DataSource = lst; //} //else // frmSanXuat_Load(sender, e); }
private void hiendonhang_CheckedChanged(object sender, EventArgs e) { if (hiendonhang.Checked == true) { btnXacNhan.Enabled = false; var db = new MyDBContextDataContext(); var lst = (from s in db.DonSanXuat_QuanLyDonhang_View() where s.BoPhan == PrintRibbon.kts select s).ToList(); foreach (var item in lst) { if (item.NghiepVu_XuongDon != null) { item.NghiepVu_XuongDon = "True"; NghiepvuCheck.ValueChecked = "True"; } if (item.ThietKeNhan != null) { item.ThietKeNhan = "True"; thietkenhancheck.ValueChecked = "True"; } if (item.ThietKeHoanThanh != null) { item.ThietKeHoanThanh = "True"; thietkehtcheck.ValueChecked = "True"; } if (item.CtpNhan != null) { item.CtpNhan = "True"; CtpNhanCheck.ValueChecked = "True"; } if (item.CtpHoanThanh != null) { item.CtpHoanThanh = "True"; CtpHoanthanhCheck.ValueChecked = "True"; } if (item.OffsetNhan != null) { item.OffsetNhan = "True"; OffsetNhanCheck.ValueChecked = "True"; } if (item.OffsetHoanThanh != null) { item.OffsetHoanThanh = "True"; OffsetHoanthanhCheck.ValueChecked = "True"; } if (item.KyThuatSoNhan != null) { item.KyThuatSoNhan = "True"; KtsNhanCheck.ValueChecked = "True"; } if (item.KyThuatSoHoanThanh != null) { item.KyThuatSoHoanThanh = "True"; KtsHoanthanhCheck.ValueChecked = "True"; } if (item.DanhThiepNhan != null) { item.DanhThiepNhan = "True"; DanhthiepNhanCheck.ValueChecked = "True"; } if (item.DanhThiepHoanThanh != null) { item.DanhThiepHoanThanh = "True"; DanhthiepHoanthanhCheck.ValueChecked = "True"; } if (item.StickerNhan != null) { item.StickerNhan = "True"; StickerNhanCheck.ValueChecked = "True"; } if (item.StickerHoanThanh != null) { item.StickerHoanThanh = "True"; StickerHoanthanhCheck.ValueChecked = "True"; } if (item.TemVaiNhan != null) { item.TemVaiNhan = "True"; TemvaiNhanCheck.ValueChecked = "True"; } if (item.TemVaiHoanThanh != null) { item.TemVaiHoanThanh = "True"; TemvaiHoanthanhCheck.ValueChecked = "True"; } if (item.InChuNhan != null) { item.InChuNhan = "True"; InchuNhanCheck.ValueChecked = "True"; } if (item.InChuHoanThanh != null) { item.InChuHoanThanh = "True"; InchuHoanThanhCheck.ValueChecked = "True"; } if (item.KiemPhamNhan != null) { item.KiemPhamNhan = "True"; KiemphamNhanCheck.ValueChecked = "True"; } if (item.KhoBTPNhan != null) { item.KhoBTPNhan = "True"; KhoNhanCheck.ValueChecked = "True"; } if (item.SauInNhan != null) { item.SauInNhan = "True"; SauinNhanCheck.ValueChecked = "True"; } if (item.SauInHoanThanh != null) { item.SauInHoanThanh = "True"; SauinHoanthanhCheck.ValueChecked = "True"; } if (item.HoanThanh != null) { item.HoanThanh = "True"; SanxuatHoanThanhCheck.ValueChecked = "True"; } } procQuanLyDonhang_ViewGridControl.DataSource = lst; } else { frmKyThuatSo_Load(sender, e); btnXacNhan.Enabled = true; } }
public void check() { var db = new MyDBContextDataContext(); var lst = (from s in db.DonSanXuat_QuanLyDonhang_View() where s.KyThuatSoHoanThanh == null && s.NghiepVu_XuongDon != null && s.BoPhan == PrintRibbon.kts select s).ToList(); //var lst = (from s in db.tbQuanLyDonHangs join x in db.tbDonSanXuats on s.IDQuanLyDonHang equals x.SCD select s).ToList(); foreach (var item in lst) { if (item.NghiepVu_XuongDon != null) { item.NghiepVu_XuongDon = "True"; NghiepvuCheck.ValueChecked = "True"; } if (item.ThietKeNhan != null) { item.ThietKeNhan = "True"; thietkenhancheck.ValueChecked = "True"; } if (item.ThietKeHoanThanh != null) { item.ThietKeHoanThanh = "True"; thietkehtcheck.ValueChecked = "True"; } if (item.CtpNhan != null) { item.CtpNhan = "True"; CtpNhanCheck.ValueChecked = "True"; } if (item.CtpHoanThanh != null) { item.CtpHoanThanh = "True"; CtpHoanthanhCheck.ValueChecked = "True"; } if (item.OffsetNhan != null) { item.OffsetNhan = "True"; OffsetNhanCheck.ValueChecked = "True"; } if (item.OffsetHoanThanh != null) { item.OffsetHoanThanh = "True"; OffsetHoanthanhCheck.ValueChecked = "True"; } if (item.KyThuatSoNhan != null) { item.KyThuatSoNhan = "True"; KtsNhanCheck.ValueChecked = "True"; } if (item.KyThuatSoHoanThanh != null) { item.KyThuatSoHoanThanh = "True"; KtsHoanthanhCheck.ValueChecked = "True"; } if (item.DanhThiepNhan != null) { item.DanhThiepNhan = "True"; DanhthiepNhanCheck.ValueChecked = "True"; } if (item.DanhThiepHoanThanh != null) { item.DanhThiepHoanThanh = "True"; DanhthiepHoanthanhCheck.ValueChecked = "True"; } if (item.StickerNhan != null) { item.StickerNhan = "True"; StickerNhanCheck.ValueChecked = "True"; } if (item.StickerHoanThanh != null) { item.StickerHoanThanh = "True"; StickerHoanthanhCheck.ValueChecked = "True"; } if (item.TemVaiNhan != null) { item.TemVaiNhan = "True"; TemvaiNhanCheck.ValueChecked = "True"; } if (item.TemVaiHoanThanh != null) { item.TemVaiHoanThanh = "True"; TemvaiHoanthanhCheck.ValueChecked = "True"; } if (item.InChuNhan != null) { item.InChuNhan = "True"; InchuNhanCheck.ValueChecked = "True"; } if (item.InChuHoanThanh != null) { item.InChuHoanThanh = "True"; InchuHoanThanhCheck.ValueChecked = "True"; } if (item.KiemPhamNhan != null) { item.KiemPhamNhan = "True"; KiemphamNhanCheck.ValueChecked = "True"; } if (item.KhoBTPNhan != null) { item.KhoBTPNhan = "True"; KhoNhanCheck.ValueChecked = "True"; } if (item.KhoBTPHoanThanh != null) { item.KhoBTPHoanThanh = "True"; KhoHoanthanhCheck.ValueChecked = "True"; } if (item.SauInNhan != null) { item.SauInNhan = "True"; SauinNhanCheck.ValueChecked = "True"; } if (item.SauInHoanThanh != null) { item.SauInHoanThanh = "True"; SauinHoanthanhCheck.ValueChecked = "True"; } if (item.HoanThanh != null) { item.HoanThanh = "True"; SanxuatHoanThanhCheck.ValueChecked = "True"; } } procQuanLyDonhang_ViewGridControl.DataSource = lst; }
private void simpleButton1_Click(object sender, EventArgs e) { var db = new MyDBContextDataContext(); var procqldh = (from a in db.DonSanXuat_QuanLyDonhang_View() where a.SCD == sCDTextEdit.Text select a).Single(); if (procqldh.HoanThanh == null) { var tb = (from s in db.tbDonSanXuats where s.SCD == sCDTextEdit.Text select s).Single(); tb.MaDonHang = maDonHangTextEdit.Text; tb.PhienBan = txtPhienBan.Text; tb.TenKhachHang = txtKhachHang.Text; tb.NgayXuongDon = ngayXuongDonDateEdit.DateTime; tb.NgayGiaoHang = ngayGiaoHangDateEdit.DateTime; tb.TenSanPham = txtTenSanPham.Text; tb.LoaiSanPham = txtLoaiSanPham.Text; tb.PhuongPhapIn = txtPhuongPhapIn.Text; tb.KichThuoc = kichThuocTextEdit.Text; tb.SoLuong = int.Parse(soLuongSpinEdit.Text); tb.VatLieu = vatLieuComboBox.Text; tb.GiaCongMatPhai = giaCongMatPhaiTextEdit.Text; tb.GiaCongMatTrai = giaCongMatTraiTextEdit.Text; tb.MauMatPhai = mauMatPhaiTextEdit.Text; tb.MauMatTrai = mauMatTraiTextEdit.Text; tb.PhuongPhapCat = phuongPhapCatTextEdit.Text; tb.BoGoc = boGocTextEdit.Text; tb.DucLo = ducLoTextEdit.Text; tb.LoaiChi = loaiChiTextEdit.Text; tb.ChuY = chuYTextEdit.Text; tb.BoPhan = txtBoPhan.Text; tb.ChamCatDapHop = chamCatDapHopTextEdit.Text; tb.DoDai = doDaiTextEdit.Text; tb.GiaCongSau = giaCongSauTextEdit.Text; tb.InChu_MaVach = inChu_MaVachTextEdit.Text; tb.Kho = txtKho.Text; tb.BTPSoLuongTonKho = Convert.ToInt32(bTPSoLuongTonKhoSpinEdit.Value); tb.TPSoLuongTonKho = Convert.ToInt32(tPSoLuongTonKhoSpinEdit.Value); tb.BTPTonKhoCongTy = Convert.ToInt32(bTPTonKhoCongtySpinEdit.Value); tb.TPTonKhoCongTy = Convert.ToInt32(TPTonKhoCongtySpinEdit.Value); tb.ThoiGianXuongDon = DateTime.Now; tb.Khac = khacTextEdit.Text; tb.SKU = (int)txtSKU.Value; if (procqldh.NghiepVu_XuongDon != null) { tb.ChinhSua = "1"; } var tiente = (from s in db.tbQuanLyTienTes where s.IDTienTe == sCDTextEdit.Text select s).Single(); tiente.IDTienTe = sCDTextEdit.Text; tiente.DonGiaSanPham = Convert.ToDouble(donGiaSanPhamSpinEdit.Value); tiente.DonGiaKhuon = Convert.ToDouble(donGiaKhuonSpinEdit.Value); tiente.DonGiaMau = Convert.ToDouble(donGiaMauSpinEdit.Value); tiente.DonGiaVanChuyen = Convert.ToDouble(donGiaVanChuyenSpinEdit.Value); tiente.TongTien = Convert.ToDouble(tongTienSpinEdit.Value); tiente.NgoaiTe = ngoaiTeComboBox.Text; if (CheckVAT.Checked) { tiente.VAT = 1.1; } else { tiente.VAT = 1; } db.SubmitChanges(); MessageBox.Show(capnhat); var soluong = tb.SoLuong; double scrap = 0; var dsx = db.tbDonSanXuat_Averies.ToList(); var ll = (from s in db.tbLanhLieus where s.IDLanhLieu == sCDTextEdit.Text select s).Single(); foreach (var item in dsx) { if (item.SO != txtTenSanPham.Text) { continue; } if (soluong / item.SKU > 1000) { scrap = 0.02; } else if (soluong / item.SKU > 500) { scrap = 0.04; } else if (soluong / item.SKU > 300) { scrap = 0.06; } else if (soluong / item.SKU > 200) { scrap = 0.08; } else if (soluong / item.SKU > 100) { scrap = 0.12; } else if (soluong / item.SKU <= 100) { scrap = 0.21; } ll.LanhLieu = (int)((1 + scrap) * (soluong * 1.1 + item.SKU * 5 + Math.Round((double)item.Qty / 500, 0) * 6 + 15 + 15) * ((item.Length / 1000) + (item.SKU - 1) * 2 + 6) / 0.9144); ll.SoLuongSanXuat = soluong; ll.BuHao = 1.1; ll.DonViTinh = "YARD"; db.SubmitChanges(); } frmDonSanXuat_Avery_CapNhat_Load(sender, e); } else { MessageBox.Show("Đơn hàng đã hoàn thành, không thể cập nhật"); } }
private void hiendonhang_CheckedChanged(object sender, EventArgs e) { if (hiendonhang.Checked == true) { btnXacNhan.Enabled = false; var db = new MyDBContextDataContext(); var lst = (from s in db.DonSanXuat_QuanLyDonhang_View() where s.NghiepVu_XuongDon != null && (s.BoPhan == sauin || s.BoPhan == offset || s.BoPhan == kts) select s).ToList(); foreach (var item in lst) { if (item.NghiepVu_XuongDon != null) { item.NghiepVu_XuongDon = "True"; NghiepvuCheck.ValueChecked = "True"; } if (item.OffsetNhan != null) { item.OffsetNhan = "True"; OffsetNhanCheck.ValueChecked = "True"; } if (item.OffsetHoanThanh != null) { item.OffsetHoanThanh = "True"; OffsetHoanthanhCheck.ValueChecked = "True"; } if (item.KyThuatSoNhan != null) { item.KyThuatSoNhan = "True"; KtsNhanCheck.ValueChecked = "True"; } if (item.KyThuatSoHoanThanh != null) { item.KyThuatSoHoanThanh = "True"; KtsHoanthanhCheck.ValueChecked = "True"; } if (item.DanhThiepNhan != null) { item.DanhThiepNhan = "True"; DanhthiepNhanCheck.ValueChecked = "True"; } if (item.DanhThiepHoanThanh != null) { item.DanhThiepHoanThanh = "True"; DanhthiepHoanthanhCheck.ValueChecked = "True"; } if (item.KiemPhamNhan != null) { item.KiemPhamNhan = "True"; KiemphamNhanCheck.ValueChecked = "True"; } if (item.KiemPhamHoanThanh != null) { item.KiemPhamHoanThanh = "True"; KiemphamHoanthanhCheck.ValueChecked = "True"; } if (item.SauInNhan != null) { item.SauInNhan = "True"; SauinNhanCheck.ValueChecked = "True"; } if (item.SauInHoanThanh != null) { item.SauInHoanThanh = "True"; SauinHoanthanhCheck.ValueChecked = "True"; } if (item.HoanThanh != null) { item.HoanThanh = "True"; SanxuatHoanThanhCheck.ValueChecked = "True"; } } procQuanLyDonhang_ViewGridControl.DataSource = lst; } else { frmSauIn_Load(sender, e); btnXacNhan.Enabled = true; } }
//where s.SauInHoanThanh == null && s.BoPhan == "SAU IN" || s.BoPhan == "OFFSET" || s.BoPhan == "KỸ THUẬT SỐ" //where s.SauInHoanThanh == null && s.BoPhan == "SAU IN" || (s.BoPhan == "OFFSET" && s.OffsetHoanThanh != null) || (s.BoPhan == "KỸ THUẬT SỐ" && s.KyThuatSoHoanThanh != null) public void check() { var db = new MyDBContextDataContext(); var lst = (from s in db.DonSanXuat_QuanLyDonhang_View() where s.SauInHoanThanh == null && s.NghiepVu_XuongDon != null && (s.BoPhan == sauin || s.BoPhan == offset || s.BoPhan == kts) select s).ToList(); foreach (var item in lst) { if (item.NghiepVu_XuongDon != null) { item.NghiepVu_XuongDon = "True"; NghiepvuCheck.ValueChecked = "True"; } if (item.OffsetNhan != null) { item.OffsetNhan = "True"; OffsetNhanCheck.ValueChecked = "True"; } if (item.OffsetHoanThanh != null) { item.OffsetHoanThanh = "True"; OffsetHoanthanhCheck.ValueChecked = "True"; } if (item.KyThuatSoNhan != null) { item.KyThuatSoNhan = "True"; KtsNhanCheck.ValueChecked = "True"; } if (item.KyThuatSoHoanThanh != null) { item.KyThuatSoHoanThanh = "True"; KtsHoanthanhCheck.ValueChecked = "True"; } if (item.DanhThiepNhan != null) { item.DanhThiepNhan = "True"; DanhthiepNhanCheck.ValueChecked = "True"; } if (item.DanhThiepHoanThanh != null) { item.DanhThiepHoanThanh = "True"; DanhthiepHoanthanhCheck.ValueChecked = "True"; } if (item.KiemPhamNhan != null) { item.KiemPhamNhan = "True"; KiemphamNhanCheck.ValueChecked = "True"; } if (item.KiemPhamHoanThanh != null) { item.KiemPhamHoanThanh = "True"; KiemphamHoanthanhCheck.ValueChecked = "True"; } if (item.SauInNhan != null) { item.SauInNhan = "True"; SauinNhanCheck.ValueChecked = "True"; } if (item.SauInHoanThanh != null) { item.SauInHoanThanh = "True"; SauinHoanthanhCheck.ValueChecked = "True"; } if (item.HoanThanh != null) { item.HoanThanh = "True"; SanxuatHoanThanhCheck.ValueChecked = "True"; } } procQuanLyDonhang_ViewGridControl.DataSource = lst; }
private void simpleButton1_Click(object sender, EventArgs e) { var db = new MyDBContextDataContext(); var procqldh = (from a in db.DonSanXuat_QuanLyDonhang_View() where a.SCD == sCDTextEdit.Text select a).Single(); if (procqldh.HoanThanh == null) { var tb = (from s in db.tbDonSanXuats where s.SCD == sCDTextEdit.Text select s).Single(); tb.MaDonHang = maDonHangTextEdit.Text; tb.PhienBan = txtPhienBan.Text; tb.TenKhachHang = txtKhachHang.Text; tb.NgayXuongDon = ngayXuongDonDateEdit.DateTime; tb.NgayGiaoHang = ngayGiaoHangDateEdit.DateTime; tb.TenSanPham = tenSanPhamComboBox.Text; tb.LoaiSanPham = txtLoaiSanPham.Text; tb.PhuongPhapIn = txtPhuongPhapIn.Text; tb.KichThuoc = kichThuocTextEdit.Text; tb.SoLuong = int.Parse(soLuongSpinEdit.Text); tb.VatLieu = vatLieuComboBox.Text; tb.GiaCongMatPhai = giaCongMatPhaiTextEdit.Text; tb.GiaCongMatTrai = giaCongMatTraiTextEdit.Text; tb.MauMatPhai = mauMatPhaiTextEdit.Text; tb.MauMatTrai = mauMatTraiTextEdit.Text; tb.PhuongPhapCat = phuongPhapCatTextEdit.Text; tb.BoGoc = boGocTextEdit.Text; tb.DucLo = ducLoTextEdit.Text; tb.LoaiChi = loaiChiTextEdit.Text; tb.ChuY = chuYTextEdit.Text; tb.BoPhan = txtBoPhan.Text; tb.ChamCatDapHop = chamCatDapHopTextEdit.Text; tb.DoDai = doDaiTextEdit.Text; tb.GiaCongSau = giaCongSauTextEdit.Text; tb.InChu_MaVach = inChu_MaVachTextEdit.Text; tb.SKU = (int)txtSKU.Value; tb.Kho = txtKho.Text; tb.BTPSoLuongTonKho = Convert.ToInt32(bTPSoLuongTonKhoSpinEdit.Value); tb.TPSoLuongTonKho = Convert.ToInt32(tPSoLuongTonKhoSpinEdit.Value); tb.BTPTonKhoCongTy = Convert.ToInt32(bTPTonKhoCongtySpinEdit.Value); tb.TPTonKhoCongTy = Convert.ToInt32(TPTonKhoCongtySpinEdit.Value); tb.ThoiGianXuongDon = DateTime.Now; tb.NhanVienNghiepVu = nvObj.Tennhanvien; if (procqldh.NghiepVu_XuongDon != null) { tb.ChinhSua = "1"; } var tiente = (from s in db.tbQuanLyTienTes where s.IDTienTe == sCDTextEdit.Text select s).Single(); if (tiente.QuanLy == null) { tiente.IDTienTe = sCDTextEdit.Text; tiente.DonGiaSanPham = Convert.ToDouble(donGiaSanPhamSpinEdit.Value); tiente.DonGiaKhuon = Convert.ToDouble(donGiaKhuonSpinEdit.Value); tiente.DonGiaMau = Convert.ToDouble(donGiaMauSpinEdit.Value); tiente.DonGiaVanChuyen = Convert.ToDouble(donGiaVanChuyenSpinEdit.Value); tiente.TongTien = Convert.ToDouble(tongTienSpinEdit.Value); tiente.NgoaiTe = ngoaiTeComboBox.Text; tiente.GiaTienUSD = (int)txtGiaTienUSD.Value; if (CheckVAT.Checked) { tiente.VAT = 1.1; } else if (CheckVAT.CheckState == CheckState.Unchecked || tongTienSpinEdit.Text == null) { tiente.VAT = 1; } if (nvObj.Chucvu == "Quản Lý") { tiente.QuanLy = "1"; } } else if (nvObj.Chucvu == "Quản Lý" && tiente.QuanLy == "1" && tiente.KetChuyen == null) { tiente.IDTienTe = sCDTextEdit.Text; tiente.DonGiaSanPham = Convert.ToDouble(donGiaSanPhamSpinEdit.Value); tiente.DonGiaKhuon = Convert.ToDouble(donGiaKhuonSpinEdit.Value); tiente.DonGiaMau = Convert.ToDouble(donGiaMauSpinEdit.Value); tiente.DonGiaVanChuyen = Convert.ToDouble(donGiaVanChuyenSpinEdit.Value); tiente.TongTien = Convert.ToDouble(tongTienSpinEdit.Value); tiente.NgoaiTe = ngoaiTeComboBox.Text; if (CheckVAT.Checked) { tiente.VAT = 1.1; } else if (CheckVAT.CheckState == CheckState.Unchecked || tongTienSpinEdit.Text == null) { tiente.VAT = 1; } } var baocao = (from s in db.tbBaoCaoThietKes where s.IDBaoCaoThietKe == sCDTextEdit.Text select s).Single(); baocao.Size = khacTextEdit.Text; baocao.SpSize = soLuongSpinEdit.Text; db.SubmitChanges(); MessageBox.Show(PrintRibbon.capnhat); frmDonSanXuat_CapNhat_Load(sender, e); } else { MessageBox.Show("Đơn hàng đã hoàn thành, không thể cập nhật"); } }
//where s.SauInHoanThanh == null && s.BoPhan == "SAU IN" || s.BoPhan == "OFFSET" || s.BoPhan == "KỸ THUẬT SỐ" public void check() { var db = new MyDBContextDataContext(); var lst = (from s in db.DonSanXuat_QuanLyDonhang_View() where s.NghiepVu_XuongDon != null && s.CtfHoanThanh == null && (s.BoPhan == temvai || s.BoPhan == sticker) select s).ToList(); foreach (var item in lst) { if (item.NghiepVu_XuongDon != null) { item.NghiepVu_XuongDon = "True"; _nghiepvuCheck.ValueChecked = "True"; } if (item.ThietKeNhan != null) { item.ThietKeNhan = "True"; thietkenhancheck.ValueChecked = "True"; } if (item.ThietKeHoanThanh != null) { item.ThietKeHoanThanh = "True"; thietkehtcheck.ValueChecked = "True"; } if (item.CtfNhan != null) { item.CtfNhan = "True"; CtfNhanCheck.ValueChecked = "True"; } if (item.CtfHoanThanh != null) { item.CtfHoanThanh = "True"; CtfHoanThanhCheck.ValueChecked = "True"; } if (item.StickerNhan != null) { item.StickerNhan = "True"; StickerNhanCheck.ValueChecked = "True"; } if (item.StickerHoanThanh != null) { item.StickerHoanThanh = "True"; StickerHoanthanhCheck.ValueChecked = "True"; } if (item.TemVaiNhan != null) { item.TemVaiNhan = "True"; TemvaiNhanCheck.ValueChecked = "True"; } if (item.TemVaiHoanThanh != null) { item.TemVaiHoanThanh = "True"; TemvaiHoanthanhCheck.ValueChecked = "True"; } if (item.HoanThanh != null) { item.HoanThanh = "True"; SanxuatHoanThanhCheck.ValueChecked = "True"; } } procQuanLyDonhang_ViewGridControl.DataSource = lst; }
public void Check() { var db = new MyDBContextDataContext(); var lst = (from s in db.DonSanXuat_QuanLyDonhang_View() where s.CtpHoanThanh == null && s.NghiepVu_XuongDon != null && (s.BoPhan == offset || s.BoPhan == danhthiep) select s).ToList(); //var lst = (from s in db.tbQuanLyDonHangs join x in db.tbDonSanXuats on s.IDQuanLyDonHang equals x.SCD select s).ToList(); foreach (var item in lst) { if (item.NghiepVu_XuongDon != null) { item.NghiepVu_XuongDon = "True"; _nghiepvuCheck.ValueChecked = "True"; } if (item.CtpNhan != null) { item.CtpNhan = "True"; CtpNhanCheck.ValueChecked = "True"; } if (item.CtpHoanThanh != null) { item.CtpHoanThanh = "True"; CtpHoanthanhCheck.ValueChecked = "True"; } if (item.ThietKeNhan != null) { item.ThietKeNhan = "True"; thietkenhancheck.ValueChecked = "True"; } if (item.ThietKeHoanThanh != null) { item.ThietKeHoanThanh = "True"; thietkehtcheck.ValueChecked = "True"; } if (item.OffsetNhan != null) { item.OffsetNhan = "True"; OffsetNhanCheck.ValueChecked = "True"; } if (item.OffsetHoanThanh != null) { item.OffsetHoanThanh = "True"; OffsetHoanthanhCheck.ValueChecked = "True"; } if (item.DanhThiepNhan != null) { item.DanhThiepNhan = "True"; OffsetNhanCheck.ValueChecked = "True"; } if (item.DanhThiepHoanThanh != null) { item.DanhThiepHoanThanh = "True"; DanhthiepHoanthanhCheck.ValueChecked = "True"; } if (item.HoanThanh != null) { item.HoanThanh = "True"; SanxuatHoanThanhCheck.ValueChecked = "True"; } } procQuanLyDonhang_ViewGridControl.DataSource = lst; }