/// <summary> /// Xóa dữ liệu chỉ tiêu /// </summary> /// <param name="iID_MaChungTu"></param> /// <param name="IPSua"></param> /// <param name="MaNguoiDungSua"></param> /// <returns></returns> public static int Delete_ChungTu(String iID_MaChungTu, String IPSua, String MaNguoiDungSua) { SqlCommand cmd; //Xóa dữ liệu trong bảng TCDN_ChungTuChiTiet //kiem tra du lieu bang TCDN_ChungTuChiTiet String SQL = "SELECT COUNT(*) FROM TCDN_ChungTuChiTiet WHERE iID_MaChungTu=@iID_MaChungTu"; cmd = new SqlCommand(SQL); cmd.Parameters.AddWithValue("@iID_MaChungTu", iID_MaChungTu); int check =Convert.ToInt32(Connection.GetValue(cmd, 1)); if (check == 0) { cmd = new SqlCommand("DELETE FROM TCDN_ChungTuChiTiet WHERE iID_MaChungTu=@iID_MaChungTu"); cmd.Parameters.AddWithValue("@iID_MaChungTu", iID_MaChungTu); Connection.UpdateDatabase(cmd); cmd.Dispose(); //Xóa dữ liệu trong bảng TCDN_ChungTu Bang bang = new Bang("TCDN_ChungTu"); bang.MaNguoiDungSua = MaNguoiDungSua; bang.IPSua = IPSua; bang.GiaTriKhoa = iID_MaChungTu; bang.Delete(); return 1; } else return 0; }
public ActionResult Delete(String iID_MaSanPham) { Bang bang = new Bang("DM_SanPham"); bang.GiaTriKhoa = iID_MaSanPham; bang.Delete(); return RedirectToAction("Index", new {}); }
/// <summary> /// Xóa dữ liệu chỉ tiêu /// </summary> /// <param name="iID_MaChungTu"></param> /// <param name="IPSua"></param> /// <param name="MaNguoiDungSua"></param> /// <returns></returns> public static int Delete_ChungTu(String iID_MaChungTu, String sIPSua, String sID_MaNguoiDungSua) { DataTable dt = GetChungTu(iID_MaChungTu); int iID_MaTrangThaiDuyet = Convert.ToInt32(dt.Rows[0]["iID_MaTrangThaiDuyet"]); String MaND = Convert.ToString(dt.Rows[0]["sID_MaNguoiDungTao"]); //Phuonglt yêu cầu cấp trợ lý tổng hợp được xóa tất cả cấp trợ lý phòng ban, tài khoản nào thuộc cấp trợ lý phòng ban // thì chỉ được xóa chứng từ của tài khoản đó tạo if ((sID_MaNguoiDungSua == MaND || LuongCongViecModel.KiemTra_TroLyTongHop(sID_MaNguoiDungSua)) && LuongCongViecModel.KiemTra_TrangThaiKhoiTao(CongSanModels.iID_MaPhanHe, iID_MaTrangThaiDuyet)) { //Xóa dữ liệu trong bảng KTCS_ChungTuChiTiet SqlCommand cmd; cmd = new SqlCommand("UPDATE KTCS_ChungTuChiTiet SET iTrangThai=0, sIPSua=@sIPSua, sID_MaNguoiDungSua=@sID_MaNguoiDungSua WHERE iID_MaChungTu=@iID_MaChungTu"); cmd.Parameters.AddWithValue("@iID_MaChungTu", iID_MaChungTu); cmd.Parameters.AddWithValue("@sIPSua", sIPSua); cmd.Parameters.AddWithValue("@sID_MaNguoiDungSua", sID_MaNguoiDungSua); Connection.UpdateDatabase(cmd); cmd.Dispose(); //Xóa dữ liệu trong bảng KT_ChungTu Bang bang = new Bang("KTCS_ChungTu"); bang.MaNguoiDungSua = sID_MaNguoiDungSua; bang.IPSua = sIPSua; bang.GiaTriKhoa = iID_MaChungTu; bang.Delete(); dt.Dispose(); } return 1; }
public ActionResult Delete(String iID_MaChiTietGia, String iID_MaSanPham) { Bang bang = new Bang("DM_SanPham_ChiTietGia"); bang.GiaTriKhoa = iID_MaChiTietGia; bang.Delete(); return RedirectToAction("Index", new { iID_MaSanPham = iID_MaSanPham }); }
public ActionResult Delete_Gom(String iID_MaChungTu, String sLNS) { if (BaoMat.ChoPhepLamViec(User.Identity.Name, "DT_ChungTu_TLTH", "Delete") == false) { return RedirectToAction("Index", "PermitionMessage"); } Bang bang = new Bang("DT_ChungTu_TLTH"); bang.GiaTriKhoa = iID_MaChungTu; bang.Delete(); //update lai trang thai check bang chung tu String iID_MaChungTu_ChungTu = Convert.ToString(CommonFunction.LayTruong("DT_ChungTu_TLTH", "iID_MaChungTu_TLTH", iID_MaChungTu, "iID_MaChungTu")); String DK = ""; String[] arrChungtu = iID_MaChungTu_ChungTu.Split(','); SqlCommand cmd = new SqlCommand(); for (int j = 0; j < arrChungtu.Length; j++) { DK += " iID_MaChungTu =@iID_MaChungTu" + j; if (j < arrChungtu.Length - 1) DK += " OR "; cmd.Parameters.AddWithValue("@iID_MaChungTu" + j, arrChungtu[j]); } String SQL = @"UPDATE DT_ChungTu SET iCheck=0 WHERE iTrangThai=1 AND (" + DK + ")"; cmd.CommandText = SQL; Connection.UpdateDatabase(cmd); cmd.Dispose(); if (sLNS == "1040100") return RedirectToAction("Index", "DuToan_ChungTu_BaoDam", new { iLoai = 1, sLNS = sLNS }); return RedirectToAction("Index", "DuToan_ChungTu", new { iLoai = 1, sLNS = sLNS }); }
public ActionResult Delete(String iID_MaDoanhNghiep) { Bang bang = new Bang("TCDN_DoanhNghiep"); bang.GiaTriKhoa = iID_MaDoanhNghiep; bang.Delete(); return RedirectToAction("Index", "TCDN_HoSo_DoanhNghiep"); }
public ActionResult Delete_LinhVuc(String iID_MaDoanhNghiep, String iID_Ma) { Bang bang = new Bang("TCDN_LinhVuc"); bang.GiaTriKhoa = iID_Ma; bang.Delete(); return RedirectToAction("Edit", "TCDN_HoSo_DoanhNghiep", new { iID_MaDoanhNghiep = iID_MaDoanhNghiep, iLoai = 2 }); }
public ActionResult Delete_CongTyLDLK(String iID_MaDoanhNghiep, String iID_Ma) { Bang bang = new Bang("TCDN_CongTyLienDoanhLienKet"); bang.GiaTriKhoa = iID_Ma; bang.Delete(); return RedirectToAction("Edit", "TCDN_HoSo_DoanhNghiep", new { iID_MaDoanhNghiep = iID_MaDoanhNghiep, iLoai = 4 }); }
public ActionResult Delete(string iID_MaBangLuongChiTiet) { Bang bang = new Bang("L_BangLuongChiTiet"); bang.MaNguoiDungSua = User.Identity.Name; bang.IPSua = Request.UserHostAddress; bang.GiaTriKhoa = iID_MaBangLuongChiTiet; bang.Delete(); return RedirectToAction("Index", "BangLuong"); }
public static Boolean Delete(String iID_MaChiTieu) { Boolean vR = false; Bang bang = new Bang("TCDN_ChiTieu"); bang.GiaTriKhoa = iID_MaChiTieu; bang.Delete(); vR = true; return vR; }
public ActionResult Delete(string iID, int? page) { Bang bang = new Bang("NS_MucLucNganSach_Nganh"); bang.GiaTriKhoa = iID; bang.IPSua = Request.UserHostAddress; bang.MaNguoiDungSua = User.Identity.Name; bang.Delete(); return RedirectToAction("index", new { page = page }); }
public ActionResult Delete(string iID_MaNgachLuong) { Bang bang = new Bang("L_DanhMucNgachLuong"); bang.MaNguoiDungSua = User.Identity.Name; bang.IPSua = Request.UserHostAddress; bang.GiaTriKhoa = iID_MaNgachLuong; bang.Delete(); return RedirectToAction("Index", "Luong_DanhMucNgachLuong"); }
public ActionResult Delete(String MaPhanHe_TrangThaiDuyet_Xem) { if (BaoMat.ChoPhepLamViec(User.Identity.Name, "NS_PhanHe_TrangThaiDuyet_NhomNguoiDung", "Delete") == false || !HamChung.CoQuyenXemTheoMenu(Request.Url.AbsolutePath, User.Identity.Name)) { return RedirectToAction("Index", "PermitionMessage"); } Bang bang = new Bang("NS_PhanHe_TrangThaiDuyet_NhomNguoiDung"); bang.GiaTriKhoa = MaPhanHe_TrangThaiDuyet_Xem; bang.Delete(); return View(sViewPath + "PhanHe_TrangThaiDuyet_NhomNguoiDung_Index.aspx"); }
public ActionResult Delete(String MaTaiLieu) { if (BaoMat.ChoPhepLamViec(User.Identity.Name, "TL_Anh", "Edit") == false) { return RedirectToAction("Index", "PermitionMessage"); } Bang bang = new Bang("TL_Anh"); bang.GiaTriKhoa = MaTaiLieu; bang.Delete(); return RedirectToAction("Index"); }
public ActionResult Delete(String iID_MaChuongTrinhMucTieu) { if (BaoMat.ChoPhepLamViec(User.Identity.Name, "KT_ChuongTrinhMucTieu", "Delete") == false) { return RedirectToAction("Index", "PermitionMessage"); } Bang bang = new Bang("KT_ChuongTrinhMucTieu"); bang.GiaTriKhoa = iID_MaChuongTrinhMucTieu; bang.Delete(); return View(sViewPath + "ChuongTrinhMucTieu_Index.aspx"); }
public ActionResult Delete(String iID_MaBangLuong,String iNamLamViec,String iThangLamViec) { Bang bang = new Bang("L_BangLuong"); bang.MaNguoiDungSua = User.Identity.Name; bang.IPSua = Request.UserHostAddress; bang.GiaTriKhoa = iID_MaBangLuong; bang.Delete(); ViewData["iNamLamViec"] = iNamLamViec; ViewData["iThangLamViec"] = iThangLamViec; return View(sViewPath + "Luong_BangLuong_Index.aspx"); }
public ActionResult Delete(String Code) { if (BaoMat.ChoPhepLamViec(User.Identity.Name, "NS_PhongBan", "Delete") == false || !HamChung.CoQuyenXemTheoMenu(Request.Url.AbsolutePath, User.Identity.Name)) { return RedirectToAction("Index", "PermitionMessage"); } Bang bang = new Bang("NS_PhongBan"); bang.GiaTriKhoa = Code; bang.Delete(); return View(sViewPath + "PhongBan_Index.aspx"); }
public ActionResult DeleteDetail(String Code, String MaID) { if (BaoMat.ChoPhepLamViec(User.Identity.Name, "NS_PhongBan_DonVi", "Delete") == false || !HamChung.CoQuyenXemTheoMenu(Request.Url.AbsolutePath, User.Identity.Name)) { return RedirectToAction("Index", "PermitionMessage"); } Bang bang = new Bang("NS_PhongBan_DonVi"); bang.GiaTriKhoa = Code; bang.Delete(); // return View(sViewPath + "NguoiDung_DonVi_List.aspx?Code =" + NguoiDung); return RedirectToAction("Edit", "PhongBanDonVi", new { Code = MaID }); }
public ActionResult Delete(String iID_MaDonViThiCong) { if (BaoMat.ChoPhepLamViec(User.Identity.Name, "QLDA_DonViThiCong", "Delete") == false) { return RedirectToAction("Index", "PermitionMessage"); } Bang bang = new Bang("QLDA_DonViThiCong"); bang.GiaTriKhoa = iID_MaDonViThiCong; bang.Delete(); return View(sViewPath + "QLDA_DonViThiCong_Index.aspx"); }
public ActionResult Delete(String iID_MaKyHieuHachToanChiTiet) { if (BaoMat.ChoPhepLamViec(User.Identity.Name, "KTCS_KyHieuHachToanChiTiet", "Edit") == false) { return RedirectToAction("Index", "PermitionMessage"); } Bang bang = new Bang("KTCS_KyHieuHachToanChiTiet"); bang.IPSua = Request.UserHostAddress; bang.MaNguoiDungSua = User.Identity.Name; bang.GiaTriKhoa = iID_MaKyHieuHachToanChiTiet; bang.Delete(); return View(sViewPath + "KeToanCongSan_CauHinhHachToan_Index.aspx"); }
public ActionResult Delete(String iID_MaThongTri) { if (BaoMat.ChoPhepLamViec(User.Identity.Name, "KT_LoaiThongTri", "Delete") == false) { return RedirectToAction("Index", "PermitionMessage"); } Bang bang = new Bang("KT_LoaiThongTri"); bang.TruongKhoa = "iID_MaThongTri"; bang.GiaTriKhoa = iID_MaThongTri; bang.Delete(); return View(sViewPath + "LoaiThongTri_Index.aspx"); }
public ActionResult Deleted(String iID_VayChiTiet) { if (BaoMat.ChoPhepLamViec(User.Identity.Name, "VN_ThuVonChiTiet", "Delete") == false) { return RedirectToAction("Index", "PermitionMessage"); } //Xóa dữ liệu trong bảng DT_DotNganSach Bang bang = new Bang("VN_ThuVonChiTiet"); bang.MaNguoiDungSua = User.Identity.Name; bang.IPSua = Request.UserHostAddress; bang.GiaTriKhoa = iID_VayChiTiet; bang.Delete(); return RedirectToAction("Detail", "TraNo", new { iID_VayChiTiet = iID_VayChiTiet }); }
public ActionResult Delete(string iID_MaPhuCap) { Bang bang = new Bang("L_DanhMucPhuCap"); bang.MaNguoiDungSua = User.Identity.Name; bang.IPSua = Request.UserHostAddress; bang.GiaTriKhoa = iID_MaPhuCap; bang.Delete(); SqlCommand cmd = new SqlCommand("UPDATE L_DanhMucTruong_MucLucNganSach SET iTrangThai=0 WHERE sMaTruong=@sMaTruong"); cmd.Parameters.AddWithValue("@sMaTruong", "PhuCap_" + iID_MaPhuCap); Connection.UpdateDatabase(cmd); cmd.Dispose(); return RedirectToAction("Index", "Luong_DanhMucPhuCap"); }
public ActionResult Delete(String iID_MaGiaiThich, String iID_MaTaiKhoan) { //kiểm tra quyền có được phép xóa if (BaoMat.ChoPhepLamViec(User.Identity.Name, "KT_TaiKhoanGiaiThich", "Delete") == false) { return RedirectToAction("Index", "PermitionMessage"); } Bang bang = new Bang("KT_TaiKhoanGiaiThich"); bang.TruongKhoa = "iID_MaTaiKhoanGiaiThich"; bang.GiaTriKhoa = iID_MaGiaiThich; bang.Delete(); return RedirectToAction("Index", new { iID_MaTaiKhoan = iID_MaTaiKhoan }); }
public ActionResult Delete(string MaDanhMuc, string MaLoaiDanhMuc) { if (HamChung.CoQuyenXemTheoMenu(Request.Url.AbsolutePath, User.Identity.Name)) { Bang bang = new Bang("DC_DanhMuc"); bang.MaNguoiDungSua = User.Identity.Name; bang.IPSua = Request.UserHostAddress; bang.GiaTriKhoa = MaDanhMuc; bang.Delete(); return RedirectToAction("Detail", "LoaiDanhMuc", new {MaLoaiDanhMuc = MaLoaiDanhMuc}); } else { return RedirectToAction("Index", "PermitionMessage"); } }
public ActionResult Delete(string iID_MaBaoCao_ChuKy) { if (HamChung.CoQuyenXemTheoMenu(Request.Url.AbsolutePath, User.Identity.Name)) { Bang bang = new Bang("NS_DanhMuc_BaoCao_ChuKy"); bang.MaNguoiDungSua = User.Identity.Name; bang.IPSua = Request.UserHostAddress; bang.GiaTriKhoa = iID_MaBaoCao_ChuKy; bang.Delete(); return RedirectToAction("Index", "DanhMuc_BaoCao_ChuKy"); } else { return RedirectToAction("Index", "PermitionMessage"); } }
public static Boolean Delete(String iID_MaChiTieuHoSo) { Boolean vR = false; SqlCommand cmd = new SqlCommand(); cmd.CommandText = "DELETE FROM TCDN_HoSoDoanhNghiepChiTieu_ChiTieuCanDoi WHERE iID_MaChiTieuHoSo=@iID_MaChiTieuHoSo"; cmd.Parameters.AddWithValue("@iID_MaChiTieuHoSo", iID_MaChiTieuHoSo); Connection.GetDataTable(cmd); cmd.Dispose(); Bang bang = new Bang("TCDN_HoSoDoanhNghiep_ChiTieu"); bang.GiaTriKhoa = iID_MaChiTieuHoSo; bang.Delete(); vR = true; return vR; }
public static void Delete_ChungTu(String iID_MaCapPhat, String IPSua, String MaNguoiDungSua) { //Xóa dữ liệu trong bảng CP_CapPhatChiTiet SqlCommand cmd; cmd = new SqlCommand("UPDATE CP_CapPhatChiTiet SET iTrangThai=0 WHERE iID_MaCapPhat=@iID_MaCapPhat"); cmd.Parameters.AddWithValue("@iID_MaCapPhat", iID_MaCapPhat); Connection.UpdateDatabase(cmd); cmd.Dispose(); //Xóa dữ liệu trong bảng CP_CapPhat Bang bang = new Bang("CP_CapPhat"); bang.MaNguoiDungSua = MaNguoiDungSua; bang.IPSua = IPSua; bang.GiaTriKhoa = iID_MaCapPhat; bang.Delete(); }
public ActionResult Delete(String iID_Ma) { if (BaoMat.ChoPhepLamViec(User.Identity.Name, "KTCS_LoaiTaiSan", "Edit") == false) { return RedirectToAction("Index", "PermitionMessage"); } Bang bang = new Bang("KTCS_LoaiTaiSan"); bang.IPSua = Request.UserHostAddress; bang.MaNguoiDungSua = User.Identity.Name; bang.GiaTriKhoa = iID_Ma; if (HamChung.Checked_Delete("KTCS_NhomTaiSan", "iID_MaLoaiTaiSan", iID_Ma)) { bang.Delete(); } return View(sViewPath + "KeToanCongSan_LoaiTaiSan_Edit.aspx"); }
/// <summary> /// Xóa một mục lục đối tượng /// </summary> /// <param name="iID_MaMucLucDoiTuong"></param> /// <returns></returns> public static Boolean DeleteMucLucDoiTuong(String iID_MaMucLucDoiTuong) { Boolean vR = false; SqlCommand cmd; cmd = new SqlCommand(); cmd.CommandText = "DELETE NS_MucLucDoiTuong WHERE iID_MaMucLucDoiTuong_Cha=@iID_MaMucLucDoiTuong"; cmd.Parameters.AddWithValue("@iID_MaMucLucDoiTuong", iID_MaMucLucDoiTuong); Connection.UpdateDatabase(cmd); cmd.Dispose(); Bang bang = new Bang("NS_MucLucDoiTuong"); bang.GiaTriKhoa = iID_MaMucLucDoiTuong; bang.Delete(); vR = true; return vR; }