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 static Boolean SuaCauHinh(String sID_MaNguoiDung, Object options)
        {
            Boolean vR = false;
            Bang bang = new Bang("DC_NguoiDungCauHinh");
            bang.MaNguoiDungSua = sID_MaNguoiDung;

            Boolean okUpdate = false;
            PropertyInfo[] properties = options.GetType().GetProperties();
            for (int i = 0; i < properties.Length; i++)
            {
                bang.CmdParams.Parameters.AddWithValue("@" + properties[i].Name, properties[i].GetValue(options, null));
                okUpdate = true;
            }
            if (okUpdate)
            {
                SqlCommand cmd = new SqlCommand("SELECT iID_MaNguoiDungCauHinh FROM DC_NguoiDungCauHinh WHERE sID_MaNguoiDungTao=@sID_MaNguoiDungTao");
                cmd.Parameters.AddWithValue("@sID_MaNguoiDungTao", sID_MaNguoiDung);
                int iID_MaNguoiDungCauHinh = Convert.ToInt32( Connection.GetValue(cmd, -1));
                cmd.Dispose();
                if (iID_MaNguoiDungCauHinh >= 0)
                {
                    bang.DuLieuMoi = false;
                    bang.GiaTriKhoa = iID_MaNguoiDungCauHinh;
                }
                bang.Save();
                vR = true;
                iNamLamViec=LayCauHinhChiTiet(sID_MaNguoiDung,"iNamLamViec");
            }
            return vR;
        }
示例#3
0
        /// <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_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 EditSubmit(String ParentID)
        {
            if (BaoMat.ChoPhepLamViec(User.Identity.Name, " DM_SanPham_CauHinhDonVi", "Edit") == false)
            {
                return RedirectToAction("Index", "PermitionMessage");
            }
            String iID_MaDonVi = Convert.ToString(Request.Form[ParentID + "_iID_MaDonVi"]);
            String SQL = "SELECT COUNT(iID_MaDonVi) AS SoBanGhi FROM DM_SanPham_CauHinhDonVi WHERE iID_MaDonVi = @iID_MaDonVi";
            SqlCommand cmd = new SqlCommand(SQL);
            cmd.Parameters.AddWithValue("@iID_MaDonVi", iID_MaDonVi);
            int SoBanGhi = (int)Connection.GetValue(cmd, -1);
            if (SoBanGhi > 0)
            {
                String DelSQL = "DELETE DM_SanPham_CauHinhDonVi WHERE iID_MaDonVi = @iID_MaDonVi";
                cmd.CommandText = DelSQL;
                SqlConnection conn = new SqlConnection(Connection.ConnectionString);
                conn.Open();
                cmd.Connection = conn;
                cmd.ExecuteNonQuery();
                conn.Dispose();
            }

            Bang bang = new Bang("DM_SanPham_CauHinhDonVi");
            bang.MaNguoiDungSua = User.Identity.Name;
            bang.IPSua = Request.UserHostAddress;
            bang.TruyenGiaTri(ParentID, Request.Form);
            bang.DuLieuMoi = true;
            bang.Save();
            return RedirectToAction("Index", new { iID_MaDonVi = iID_MaDonVi });
        }
示例#6
0
 public ActionResult Delete(String iID_MaSanPham)
 {
     Bang bang = new Bang("DM_SanPham");
     bang.GiaTriKhoa = iID_MaSanPham;
     bang.Delete();
     return RedirectToAction("Index", new {});
 }
示例#7
0
        public static object Update_objVTNCC(String ck, String iID_MaVatTu, String iID_MaNhaCungCap, String sID_MaNguoiDungSua, String IPSua)
        {
            try
            {
                if (ck == "true")
                {
                    if (iID_MaVatTu != "" && iID_MaNhaCungCap != "")
                    {
                        Bang bang = new Bang("DM_VatTu_NhaCungCap");
                        bang.DuLieuMoi = true;
                        bang.CmdParams.Parameters.AddWithValue("@iID_MaVatTu", iID_MaVatTu);
                        bang.CmdParams.Parameters.AddWithValue("@iID_MaNhaCungCap", iID_MaNhaCungCap);
                        bang.MaNguoiDungSua = sID_MaNguoiDungSua;
                        bang.IPSua = IPSua;
                        bang.Save();
                        //cmd = new SqlCommand("INSERT INTO DM_NhaCungCap()iID_MaVatTu FROM DM_VatTu WHERE sMaVatTu = @sMaVatTu");
                    }
                }
                else
                {
                    SqlCommand cmd = new SqlCommand("DELETE  FROM DM_VatTu_NhaCungCap WHERE iID_MaVatTu = @iID_MaVatTu AND " +
                                                      "iID_MaNhaCungCap = @iID_MaNhaCungCap");
                    cmd.Parameters.AddWithValue("@iID_MaVatTu", iID_MaVatTu);
                    cmd.Parameters.AddWithValue("@iID_MaNhaCungCap", iID_MaNhaCungCap);
                    Connection.UpdateDatabase(cmd);
                    cmd.Dispose();
                }
            }
            catch
            {}

            return null;
        }
示例#8
0
        /// <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;
        }
        /// <summary>
        /// Thêm dữ liệu vào bảng khen thưởng
        /// </summary>
        /// <param name="ParentID"></param>
        /// <param name="OnSuccess"></param>
        /// <param name="iID_MaKhenThuong"></param>
        /// <returns></returns>
        public JavaScriptResult Edit_Fast_KhenThuong_Submit(String ParentID, String OnSuccess, String iID_MaCanBo, String iID_MaKhenThuong)
        {
            Bang bang = new Bang("CB_KhenThuong");
            bang.TruyenGiaTri(ParentID, Request.Form);
            bang.MaNguoiDungSua = User.Identity.Name;
            bang.IPSua = Request.UserHostAddress;
            bang.CmdParams.Parameters.AddWithValue("@iID_MaCanBo", iID_MaCanBo);
            if (Request.Form[ParentID + "_DuLieuMoi"] == "1")
            {
                bang.Save();
            }
            else
            {
                bang.GiaTriKhoa = iID_MaKhenThuong;
                bang.Save();
            }

            String strJ = "";
            if (String.IsNullOrEmpty(OnSuccess) == false)
            {
                strJ = String.Format("Dialog_close('{0}');{1}();", ParentID, OnSuccess);
            }
            else
            {
                strJ = String.Format("Dialog_close('{0}');", ParentID);
            }
            return JavaScript(strJ);
        }
        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 });
        }
示例#11
0
 public ActionResult ChiTiet_Submit(String ParentID)
 {
     Bang bang = new Bang("KTCS_TaiSanChiTiet");
     bang.MaNguoiDungSua = User.Identity.Name;
     bang.IPSua = Request.UserHostAddress;
     bang.TruyenGiaTri(ParentID, Request.Form);
     String dNgayMua = Convert.ToString(Request.Form[ParentID + "_vidNgayMua"]);
     String dNgayKhauHao = Convert.ToString(Request.Form[ParentID + "_vidNgayDuaVaoKhauHao"]);
     String iID_MaTaiSan = Request.Form[ParentID + "_iID_MaTaiSan"];
     DataTable dt =KTCS_TaiSanModels.Get_dtTaiSan(iID_MaTaiSan);
     bang.CmdParams.Parameters.AddWithValue("dNgayMua", CommonFunction.LayNgayTuXau(dNgayMua));
     bang.CmdParams.Parameters.AddWithValue("dNgayKhauHao", CommonFunction.LayNgayTuXau(dNgayKhauHao));
     bang.Save();
     String SQL = "UPDATE KTCS_TaiSan SET dNgayMua=@dNgayMua,dNgayDuaVaoKhauHao=@dNgayDuaVaoKhauHao WHERE iID_MaTaiSan=@iID_MaTaiSan";
     SqlCommand cmd = new SqlCommand(SQL);
     cmd.Parameters.AddWithValue("@dNgayMua", CommonFunction.LayNgayTuXau(dNgayMua));
     cmd.Parameters.AddWithValue("@dNgayDuaVaoKhauHao", CommonFunction.LayNgayTuXau(dNgayKhauHao));
     cmd.Parameters.AddWithValue("@iID_MaTaiSan", iID_MaTaiSan);
     Connection.UpdateDatabase(cmd);
     String _in=Request.Form[ParentID+"_in"];
     //if (_in == "0")
     //{
     //    return RedirectToAction("ViewPDF", "rptCongSan_ChiTietTaiSan", new { iID_MaTaiSan = iID_MaTaiSan });
     //}
     return RedirectToAction(ParentID, "KTCS_TaiSan", new { Saved = 1, In = _in, iID_MaTaiSan = iID_MaTaiSan });
 }
        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_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(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 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_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");
 }
示例#17
0
 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 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");
 }
示例#21
0
 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 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");
 }
示例#23
0
 /// <summary>
 /// Hàm lưu lần duyệt/từ chối của chứng từ
 /// </summary>
 /// <param name="iID_MaCapPhat"></param>
 /// <param name="sNoiDung"></param>
 /// <param name="sMaND"></param>
 /// <param name="sIPSua"></param>
 /// <returns></returns>
 public static String CapNhatBangDuyetChungTu(String iID_MaCapPhat, String sNoiDung, String sMaND, String sIPSua)
 {
     String MaDuyetChungTu;
     Bang bang = new Bang("CP_DuyetCapPhat");
     bang.MaNguoiDungSua = sMaND;
     bang.IPSua = sIPSua;
     bang.DuLieuMoi = true;
     bang.CmdParams.Parameters.AddWithValue("@iID_MaCapPhat", iID_MaCapPhat);
     bang.CmdParams.Parameters.AddWithValue("@sNoiDung", sNoiDung);
     MaDuyetChungTu = Convert.ToString(bang.Save());
     return MaDuyetChungTu;
 }
        public ActionResult EditSubmit(String ParentID)
        {
            Bang bang = new Bang("L_DanhMucThamSo");
            bang.MaNguoiDungSua = User.Identity.Name;
            bang.IPSua = Request.UserHostAddress;
            NameValueCollection arrLoi = bang.TruyenGiaTri(ParentID, Request.Form);

            String iID_MaThamSo = Request.Form[ParentID + "_iID_MaThamSo"];
            iID_MaThamSo = iID_MaThamSo.Trim();
            String sKyHieu = Request.Form[ParentID + "_sKyHieu"];
            String sThamSo = Request.Form[ParentID + "_sThamSo"];
            String dThoiGianApDung_BatDau = Request.Form[ParentID + "_vidThoiGianApDung_BatDau"];
            //if (HamChung.Check_Trung(bang.TenBang, bang.TruongKhoa, iID_MaThamSo, "sKyHieu", sKyHieu, bang.DuLieuMoi))
            //{
            //    arrLoi.Add("err_sKyHieu", "Không được nhập trùng ký hiệu");
            //}
            if (String.IsNullOrEmpty(dThoiGianApDung_BatDau))
            {
                arrLoi.Add("err_dThoiGianApDung_BatDau", "Bạn chưa nhập ngày áp dụng");
            }

            if (String.IsNullOrEmpty(sKyHieu))
            {
                arrLoi.Add("err_sKyHieu", "Bạn chưa nhập ký hiệu");
            }
            if (String.IsNullOrEmpty(sThamSo))
            {
                arrLoi.Add("err_sThamSo", "Bạn chưa nhập tham số");
            }

            if (arrLoi.Count == 0)
            {
                if (bang.DuLieuMoi == false)
                    bang.DuLieuMoi = true;
                //bang.GiaTriKhoa = iID_MaThamSo;
                bang.Save();
                return RedirectToAction("Index", "Luong_DanhMucThamSo");
            }
            else
            {

                for (int i = 0; i <= arrLoi.Count - 1; i++)
                {
                    ModelState.AddModelError(ParentID + "_" + arrLoi.GetKey(i), arrLoi[i]);
                }

                Dictionary<string, object> dicData = bang.LayGoiDuLieu(Request.Form, true);
                ViewData["DuLieuMoi"] = Convert.ToInt16(bang.DuLieuMoi);
                ViewData["iID_MaThamSo"] = iID_MaThamSo;
                ViewData["data"] = dicData["data"];
                return View(sViewPath + "Luong_DanhMucThamSo_Edit.aspx");
            }
        }
        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 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 EditSubmit(String ParentID)
        {
            Bang bang = new Bang("L_DanhMucBacLuong");
            bang.MaNguoiDungSua = User.Identity.Name;
            bang.IPSua = Request.UserHostAddress;
            NameValueCollection arrLoi = bang.TruyenGiaTri(ParentID, Request.Form);

            String iID_MaBacLuong = Request.Form[ParentID + "_iID_MaBacLuong"];
            iID_MaBacLuong = iID_MaBacLuong.Trim();
            String sTenBacLuong = Request.Form[ParentID + "_sTenBacLuong"];
            if (HamChung.Check_Trung(bang.TenBang, bang.TruongKhoa, iID_MaBacLuong, "iID_MaBacLuong", iID_MaBacLuong, bang.DuLieuMoi))
            {
                arrLoi.Add("err_iID_MaBacLuong", "Không được nhập trùng ký hiệu");
            }
            if (String.IsNullOrEmpty(iID_MaBacLuong))
            {
                arrLoi.Add("err_iID_MaBacLuong", "Bạn chưa nhập ký hiệu");
            }
            if (String.IsNullOrEmpty(sTenBacLuong))
            {
                arrLoi.Add("err_sTenBacLuong", "Bạn chưa nhập bậc lương");
            }

            if (arrLoi.Count == 0)
            {
                bang.GiaTriKhoa = iID_MaBacLuong;
                SqlCommand cmd = new SqlCommand();
                String SQL = "UPDATE L_DanhMucBacLuong SET sTenBacLuong=@sTenBacLuong,rHeSoLuong=@rHeSoLuong,rHeSo_ANQP=@rHeSo_ANQP,sQuanHam=@sQuanHam WHERE iID_MaBacLuong=@iID_MaBacLuong AND iID_MaNgachLuong=@iID_MaNgachLuong";

                for (int i = 0; i < bang.CmdParams.Parameters.Count; i++)
                {
                    cmd.Parameters.AddWithValue(bang.CmdParams.Parameters[i].ParameterName, bang.CmdParams.Parameters[i].Value);
                }
                cmd.Parameters.AddWithValue("@iID_MaBacLuong", iID_MaBacLuong);
                cmd.CommandText = SQL;
                Connection.UpdateDatabase(cmd);
                return RedirectToAction("Index", "Luong_DanhMucBacLuong");
            }
            else
            {

                for (int i = 0; i <= arrLoi.Count - 1; i++)
                {
                    ModelState.AddModelError(ParentID + "_" + arrLoi.GetKey(i), arrLoi[i]);
                }

                Dictionary<string, object> dicData = bang.LayGoiDuLieu(Request.Form, true);
                ViewData["DuLieuMoi"] = Convert.ToInt16(bang.DuLieuMoi);
                ViewData["iID_MaBacLuong"] = iID_MaBacLuong;
                ViewData["data"] = dicData["data"];
                return View(sViewPath + "Luong_DanhMucBacLuong_Edit.aspx");
            }
        }
        public ActionResult EditSubmit(String ParentID, String iID, int? page)
        {
            Bang bang = new Bang("NS_MucLucNganSach_Nganh");
            NameValueCollection arrLoi = bang.TruyenGiaTri(ParentID, Request.Form);
            bang.MaNguoiDungSua = User.Identity.Name;
            bang.IPSua = Request.UserHostAddress;
            String iID_MaNganhMLNS = Request.Form["iID_MaNganhMLNS"];
            String sMaNguoiQuanLy = Request.Form["sMaNguoiQuanLy"];
            String iID_MaNganh = Request.Form[ParentID + "_iID_MaNganh"];
            if (String.IsNullOrEmpty(iID_MaNganh))
            {
                arrLoi.Add("err_iID_MaNganh", "Mã ngành không được để trống");
            }
            //chi xet truong hop them moi
            if (Request.Form["DuLieuMoi"] == "1")
            {
                if (MucLucNganSach_NganhModels.CheckTonTaiMaNganh(iID_MaNganh))
                {
                    arrLoi.Add("err_iID_MaNganh", "Mã ngành đã tồn tại");
                }
            }
            if (arrLoi.Count == 0)
            {
                bang.CmdParams.Parameters.AddWithValue("@iID_MaNganhMLNS", iID_MaNganhMLNS);
                bang.CmdParams.Parameters.AddWithValue("@sMaNguoiQuanLy", sMaNguoiQuanLy);
                if (Request.Form["DuLieuMoi"] == "1")
                {

                }
                else
                {
                    bang.GiaTriKhoa = iID;
                    bang.DuLieuMoi = false;
                }
                bang.Save();
            }
            else
            {
                for (int i = 0; i <= arrLoi.Count - 1; i++)
                {
                    ModelState.AddModelError(ParentID + "_" + arrLoi.GetKey(i), arrLoi[i]);
                }
                ViewData["DuLieuMoi"] = "0";
                if (String.IsNullOrEmpty(iID))
                {
                    ViewData["DuLieuMoi"] = "1";
                }
                ViewData["iID"] = iID;
                return View(sViewPath + "DanhMucNganh_Edit.aspx");
            }

            return RedirectToAction("index", new { page = page });
        }
示例#29
0
        public ActionResult EditSubmit(String ControlID, String MaLuat)
        {
            String tg = Request.Form[ControlID + "_txt"];
            String[] arr = tg.Split(',');
            SqlCommand cmd;
            cmd = new SqlCommand();
            cmd.CommandText = "DELETE FROM PQ_Bang_ChucNangCam WHERE iID_MaLuat=@iID_MaLuat";
            cmd.Parameters.AddWithValue("@iID_MaLuat", MaLuat);
            Connection.UpdateDatabase(cmd);
            int i, j;
            for (i = 0; i < arr.Length; i++)
            {
                String[] arr1 = arr[i].Split(';');

                tg = "";
                for (j = 0; j < arr1.Length - 1; j++)
                {
                    switch (arr1[j])
                    {
                        case "0":
                            tg += "Detail" + BaoMat.KyTuTach;
                            break;
                        case "1":
                            tg += "Create" + BaoMat.KyTuTach;
                            break;
                        case "2":
                            tg += "Delete" + BaoMat.KyTuTach;
                            break;
                        case "3":
                            tg += "Edit" + BaoMat.KyTuTach;
                            break;
                        case "4":
                            tg += "Share" + BaoMat.KyTuTach;
                            break;
                        case "5":
                            tg += "Responsibility" + BaoMat.KyTuTach;
                            break;
                    }
                }
                if (tg != "")
                {
                    Bang bang = new Bang("PQ_Bang_ChucNangCam");
                    bang.MaNguoiDungSua = User.Identity.Name;
                    bang.IPSua = Request.UserHostAddress;
                    bang.CmdParams.Parameters.AddWithValue("@iID_MaLuat", MaLuat);
                    bang.CmdParams.Parameters.AddWithValue("@sTenBang", arr1[0]);
                    bang.CmdParams.Parameters.AddWithValue("@sChucNang", tg);
                    bang.Save();
                }
            }
            return RedirectToAction("Detail", "Luat", new { MaLuat = MaLuat });
        }
        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");
        }
示例#31
0
        public static void CollisionWhithPlanet(GameObject planet, GameObject go, double timeInSec)
        {
            go.isValid = false;

            Bang bang = new Bang();

            planet.model.addedObjects.Add(bang);

            bang.image = MainWindow.Clone(MainWindow.window.BigBang);
            MainWindow.window.PlayingCanvas.Children.Add(bang.image);

            bang.X = go.X;
            bang.Y = go.Y;
        }
 static void Main()
 {
     for (int i = 0; i < 5; i++)
     {
         try
         {
             Bang.Foo();
         }
         catch (Exception e)
         {
             Console.WriteLine(e.GetType().Name);
         }
     }
 }
示例#33
0
        public static void CollisionOfPlanetWhithRocket(GameObject planet, GameObject rocket, double timeInSec)
        {
            rocket.isValid = false;

            Bang bang = new Bang();

            planet.model.addedObjects.Add(bang);

            bang.image = MainWindow.Clone(MainWindow.window.LargeBang);
            MainWindow.window.PlayingCanvas.Children.Add(bang.image);

            bang.X = rocket.X;
            bang.Y = rocket.Y;
        }
示例#34
0
        public static void CollisionsOfAll(GameObject go1, GameObject go2, double timeInSec)
        {
            go1.isValid = false;
            go2.isValid = false;

            Bang bang = new Bang();

            go1.model.addedObjects.Add(bang);

            bang.image = MainWindow.Clone(MainWindow.window.Bang);
            MainWindow.window.PlayingCanvas.Children.Add(bang.image);

            bang.X = (go1.X + go2.X) / 2;
            bang.Y = (go1.Y + go2.Y) / 2;
        }
    private void MakeABang()
    {
        var bang         = new Bang(transform.position.ToCell()).Create();
        var bangSettings = bang.GetComponent <BangSettings>();

        bangSettings.distance = distance;
        bangSettings.lifeTime = bangLifeTime;
        if (bangController == null)
        {
            return;
        }
        bangSettings.stoppedTags = bangController.GetStoppedTags();
        bangSettings.AddActionWithAttackedObjects(bangController.ActionWithAttackedObjects);
        bangSettings.AddActionAfterBang(bangController.ActionAfterBang);
    }
示例#36
0
 public MainWindowViewModel(IMainWindow view, IApplication app) : base(view)
 {
     _app                = app;
     _bang               = new Bang(_app);
     ExitCommand         = Command.CreateCommand(Exit);
     AboutCommand        = Command.CreateCommand(OpenAbout);
     LogCommand          = Command.CreateCommand(OpenLog, CanOpenLog);
     OpenFlyoutCommand   = Command.CreateCommand <string>(OpenFlyout);
     SettingCommand      = Command.CreateCommand(OpenSetting, CanOpenSetting);
     UpdateCommand       = Command.CreateCommand(Update);
     OpenBangCommand     = Command.CreateCommand(OpenBang);
     ModuleImportCommand = Command.CreateCommand(ModuleImport, CanImportExport);
     ModuleExportCommand = Command.CreateCommand(ModuleExport, CanImportExport);
     ModuleAppendCommand = Command.CreateCommand(ModuleAppend, CanImportExport);
     TopMostToogle       = app.Settings.Get("Topmost", false);
 }
示例#37
0
    public override void Start(RAIN.Core.AI ai)
    {
        Bang  bang    = GameObject.Instantiate(ai.WorkingMemory.GetItem("bang") as GameObject).GetComponent <Bang> ();
        float yOffset = ai.Body.GetComponent <CapsuleCollider>().bounds.size.y;

        yOffset += 1.2f;
        Vector3 copPosition = ai.Body.transform.position;

        bang.transform.position = new Vector3(copPosition.x,
                                              copPosition.y + yOffset,
                                              copPosition.z);
        bang.transform.SetParent(ai.Body.transform, true);

        //Change the FOV Color
        FOV2DVisionCone FOV = ai.Body.transform.Find("FOV2D").GetComponent <FOV2DVisionCone>();

        FOV.status = FOV2DVisionCone.Status.Alert;

        base.Start(ai);
    }
示例#38
0
        static Deck <Card> InitializeCard() // A REVOIR
        {
            List <CardRepartition> cardRepartition = ISerialize.Deserialize <List <CardRepartition> >(@"_Datas/Cards.json");

            Deck <Card> cards = new Deck <Card>();

            foreach (CardRepartition CR in cardRepartition)
            {
                for (int i = 0; i < CR.number; i++)
                {
                    switch (CR.type)
                    {
                    case CardType.Bang:
                        Bang b = new Bang("Bang", (Couleur)rand.Next(0, 4), (Value)rand.Next(0, 13), Cible.APorteeDeTire, "Enlève un point de vie à un joueur à porté de tir", -1);
                        cards.Add(b);
                        break;

                    case CardType.Discard:
                        Discard d = new Discard("Discard", (Couleur)rand.Next(0, 4), (Value)rand.Next(0, 13), Cible.SoiMeme, "Fait échouer un Bang", -1);
                        cards.Add(d);
                        break;

                    case CardType.Draw:
                        Draw dd = new Draw("Draw", (Couleur)rand.Next(0, 4), (Value)rand.Next(0, 13), Cible.SoiMeme, "Pioche 2 cartes", -1);
                        cards.Add(dd);
                        break;

                    case CardType.Duel:
                        Duel ddd = new Duel("Duel", (Couleur)rand.Next(0, 4), (Value)rand.Next(0, 13), Cible.NimporteQui, "Provoque un duel", -1);
                        cards.Add(ddd);
                        break;

                    case CardType.Heal:
                        Heal h = new Heal("Heal", (Couleur)rand.Next(0, 4), (Value)rand.Next(0, 13), Cible.NimporteQui, "Soigne un point de vie", -1);
                        cards.Add(h);
                        break;

                    case CardType.Miss:
                        Miss m = new Miss("Miss", (Couleur)rand.Next(0, 4), (Value)rand.Next(0, 13), Cible.SoiMeme, "Esquive un Bang", -1);
                        cards.Add(m);
                        break;

                    case CardType.Jail:
                        Jail j = new Jail("Jail", (Couleur)rand.Next(0, 4), (Value)rand.Next(0, 13), Cible.NimporteQui, "Emprisonne quelqu'un");
                        cards.Add(j);
                        break;

                    case CardType.ModRange:
                        ModRange mr = new ModRange("Mustang", (Couleur)rand.Next(0, 4), (Value)rand.Next(0, 13), Cible.SoiMeme, "Distance +1 pour les autres joueurs");
                        cards.Add(mr);
                        break;

                    case CardType.Stash:
                        Stash s = new Stash("Stash", (Couleur)rand.Next(0, 4), (Value)rand.Next(0, 13), Cible.SoiMeme, "Quand Bang reçu, piocher une carte, si coeur alors esquive");
                        cards.Add(s);
                        break;

                    case CardType.Weapon:
                        Weapon w = new Weapon("Pistoulet", (Couleur)rand.Next(0, 4), (Value)rand.Next(0, 13), Cible.SoiMeme, "Augmente la porté de 1");
                        cards.Add(w);
                        break;

                    default:
                        break;
                    }
                }
            }

            cards.Shuffle();

            return(cards);
        }
示例#39
0
 public static void BangHere(Transform transformers)
 {
     var  BangProj = Resources.Load("BangProj");
     Bang rwerwer  = Instantiate(BangProj, transformers.position, transformers.rotation) as Bang;
 }
示例#40
0
 public void Shoot()
 {
     Firing?.Invoke(this, EventArgs.Empty);
     Bang?.Invoke(this);
     Fired?.Invoke(this, new FiredArgs("Bang!"));
 }
示例#41
0
 public void Send(string receiver, Bang bang)
 {
     MessageInvocation.SendBang(receiver);
 }
示例#42
0
        public IType Visit(Bang node)
        {
            IType operand = Visit((dynamic)node.Operand);

            return(operand.Bang());
        }