当前位置: 首页>>代码示例>>C#>>正文


C# Bang.LayGoiDuLieu方法代码示例

本文整理汇总了C#中Bang.LayGoiDuLieu方法的典型用法代码示例。如果您正苦于以下问题:C# Bang.LayGoiDuLieu方法的具体用法?C# Bang.LayGoiDuLieu怎么用?C# Bang.LayGoiDuLieu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Bang的用法示例。


在下文中一共展示了Bang.LayGoiDuLieu方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Detail

 public ActionResult Detail(string iID_MaPhuCap)
 {
     Bang bang = new Bang("L_DanhMucPhuCap");
     bang.GiaTriKhoa = iID_MaPhuCap;
     Dictionary<string, object> dicData = bang.LayGoiDuLieu(null, false);
     if (dicData != null)
     {
         ViewData[bang.TenBang + "_dicData"] = dicData;
         return View(sViewPath + "Detail.aspx");
     }
     else
     {
         return RedirectToAction("Index");
     }
 }
开发者ID:BMSProject2015,项目名称:BMS,代码行数:15,代码来源:Luong_DanhMucPhuCapController.cs

示例2: Create

        public ActionResult Create()
        {
            if (HamChung.CoQuyenXemTheoMenu(Request.Url.AbsolutePath, User.Identity.Name))
            {
                Bang bang = new Bang("DC_LoaiDanhMuc");
                Dictionary<string, object> dicData = bang.LayGoiDuLieu(null, true);
                //dicData["iID_MaBanHang"] = bang.GiaTriKhoa;
                //dicData["LienHe_page"] = 1;

                dicData["DuLieuMoi"] = "1";
                ViewData[bang.TenBang + "_dicData"] = dicData;
                return View(sViewPath + "Edit.aspx");
            }
            else
            {
                return RedirectToAction("Index", "PermitionMessage");
            }
        }
开发者ID:BMSProject2015,项目名称:BMS,代码行数:18,代码来源:LoaiDanhMucController.cs

示例3: Create

        public ActionResult Create(string MaLoaiDanhMuc)
        {
            if (HamChung.CoQuyenXemTheoMenu(Request.Url.AbsolutePath, User.Identity.Name))
            {
                Bang bang = new Bang("DC_DanhMuc");
                Dictionary<string, object> dicData = bang.LayGoiDuLieu(null, true);
                NameValueCollection data = (NameValueCollection) dicData["data"];
                dicData["iID_MaLoaiDanhMuc"] = MaLoaiDanhMuc;
                dicData["LoaiDanhMuc"] =
                    (string) (CommonFunction.LayTruong("DC_LoaiDanhMuc", "iID_MaLoaiDanhMuc", MaLoaiDanhMuc, "sTen"));

                dicData["DuLieuMoi"] = "1";
                ViewData[bang.TenBang + "_dicData"] = dicData;
                return View(sViewPath + "Edit.aspx");
            }
            else
            {
                return RedirectToAction("Index", "PermitionMessage");
            }
        }
开发者ID:BMSProject2015,项目名称:BMS,代码行数:20,代码来源:DanhMucController.cs

示例4: Detail

 public ActionResult Detail(string MaDanhMuc)
 {
     if (HamChung.CoQuyenXemTheoMenu(Request.Url.AbsolutePath, User.Identity.Name))
     {
         Bang bang = new Bang("DC_DanhMuc");
         bang.GiaTriKhoa = MaDanhMuc;
         Dictionary<string, object> dicData = bang.LayGoiDuLieu(null, false);
         if (dicData != null)
         {
             ViewData[bang.TenBang + "_dicData"] = dicData;
             return View(sViewPath + "Detail.aspx");
         }
         else
         {
             return RedirectToAction("Index");
         }
     }
     else
     {
         return RedirectToAction("Index", "PermitionMessage");
     }
 }
开发者ID:BMSProject2015,项目名称:BMS,代码行数:22,代码来源:DanhMucController.cs

示例5: EditSubmit

        public ActionResult EditSubmit(String ParentID)
        {
            Bang bangPhuCapMucLucNS = new Bang("L_DanhMucTruong_MucLucNganSach");
            bangPhuCapMucLucNS.MaNguoiDungSua = User.Identity.Name;
            bangPhuCapMucLucNS.IPSua = Request.UserHostAddress;
            NameValueCollection arrLoi1 = bangPhuCapMucLucNS.TruyenGiaTri(ParentID, Request.Form);

            Bang bang = new Bang("L_DanhMucPhuCap");
            bang.MaNguoiDungSua = User.Identity.Name;
            bang.IPSua = Request.UserHostAddress;
            NameValueCollection arrLoi = bang.TruyenGiaTri(ParentID, Request.Form);

            String iID_MaPhuCap = Request.Form[ParentID + "_iID_MaPhuCap"];
            iID_MaPhuCap = iID_MaPhuCap.Trim();
            String sTenPhuCap = Request.Form[ParentID + "_sTenPhuCap"];
            if (HamChung.Check_Trung(bang.TenBang, bang.TruongKhoa, iID_MaPhuCap, "iID_MaPhuCap", iID_MaPhuCap, bang.DuLieuMoi))
            {
                arrLoi.Add("err_iID_MaPhuCap", "Không được nhập trùng ký hiệu");
            }

            if (String.IsNullOrEmpty(iID_MaPhuCap))
            {
                arrLoi.Add("err_iID_MaPhuCap", "Bạn chưa nhập ký hiệu");
            }

            if (String.IsNullOrEmpty(sTenPhuCap))
            {
                arrLoi.Add("err_sTenPhuCap", "Bạn chưa nhập tên phụ cấp");
            }

            if (arrLoi.Count == 0)
            {
                bang.CmdParams.Parameters.AddWithValue("@sMaTruong","PhuCap_"+iID_MaPhuCap);
                bang.GiaTriKhoa = iID_MaPhuCap;
                bang.Save();
                Luong_DanhMucPhuCapModels.DetailSubmit(iID_MaPhuCap, User.Identity.Name, Request.UserHostAddress, Request.Form);
                return RedirectToAction("Index", "Luong_DanhMucPhuCap");
            }
            else
            {

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

                Dictionary<string, object> dicData = bang.LayGoiDuLieu(Request.Form, true);
                ViewData["DuLieuMoi"] = Convert.ToInt16(bang.DuLieuMoi);
                ViewData["iID_MaPhuCap"] = iID_MaPhuCap;
                ViewData["data"] = dicData["data"];
                return View(sViewPath + "Luong_DanhMucPhuCap_Edit.aspx");
            }
        }
开发者ID:BMSProject2015,项目名称:BMS,代码行数:57,代码来源:Luong_DanhMucPhuCapController.cs

示例6: EditSubmit

 public ActionResult EditSubmit(String ControlID, 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;
         NameValueCollection arrLoi = bang.TruyenGiaTri(ControlID, Request.Form);
         if (arrLoi.Count == 0)
         {
             bang.Save();
             return RedirectToAction("Detail", "LoaiDanhMuc", new {MaLoaiDanhMuc = MaLoaiDanhMuc});
         }
         else
         {
             Dictionary<string, object> dicData = bang.LayGoiDuLieu(Request.Form, true);
             dicData["DuLieuMoi"] = "1";
             dicData["iID_MaLoaiDanhMuc"] = MaLoaiDanhMuc;
             dicData["LoaiDanhMuc"] =
                 (string)
                 (CommonFunction.LayTruong("DC_LoaiDanhMuc", "iID_MaLoaiDanhMuc", MaLoaiDanhMuc, "sTen"));
             ViewData[bang.TenBang + "_dicData"] = dicData;
             return View(sViewPath + "Edit.aspx");
         }
     }
     else
     {
         return RedirectToAction("Index", "PermitionMessage");
     }
 }
开发者ID:BMSProject2015,项目名称:BMS,代码行数:30,代码来源:DanhMucController.cs

示例7: EditSubmit

        public ActionResult EditSubmit(String ParentID,String iID_MaDanhMucLoaiCongThuc)
        {
            Bang bang = new Bang("L_DanhMucLoaiCongThuc");
            bang.MaNguoiDungSua = User.Identity.Name;
            bang.IPSua = Request.UserHostAddress;
            NameValueCollection arrLoi = bang.TruyenGiaTri(ParentID, Request.Form);

            String sTen = Request.Form[ParentID + "_sTen"];

            if (String.IsNullOrEmpty(sTen))
            {
                arrLoi.Add("err_sTen", "Bạn chưa nhập công thức");
            }

            if (arrLoi.Count == 0)
            {
                if (bang.DuLieuMoi)
                    bang.Save();
                else
                {
                    bang.GiaTriKhoa = iID_MaDanhMucLoaiCongThuc;
                    bang.Save();
                }
                return RedirectToAction("Index", "Luong_DanhMucLoaiCongThuc");
            }
            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_MaDanhMucLoaiCongThuc"] = iID_MaDanhMucLoaiCongThuc;
                ViewData["data"] = dicData["data"];
                return View(sViewPath + "Luong_DanhMucLoaiCongThuc_Edit.aspx");
            }
        }
开发者ID:BMSProject2015,项目名称:BMS,代码行数:40,代码来源:Luong_DanhMucLoaiCongThucController.cs

示例8: EditSubmit

        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 [email protected],[email protected],[email protected]_ANQP,[email protected] WHERE [email protected]_MaBacLuong AND [email protected]_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");
            }
        }
开发者ID:BMSProject2015,项目名称:BMS,代码行数:53,代码来源:Luong_DanhMucBacLuongController.cs

示例9: EditSubmit

        public ActionResult EditSubmit(String ParentID)
        {
            Bang bang = new Bang("L_DanhMucNgachLuong");
            bang.MaNguoiDungSua = User.Identity.Name;
            bang.IPSua = Request.UserHostAddress;
            NameValueCollection arrLoi = bang.TruyenGiaTri(ParentID, Request.Form);

               String iID_MaNgachLuong = Request.Form[ParentID + "_iID_MaNgachLuong"];
            iID_MaNgachLuong = iID_MaNgachLuong.Trim();
            String sTenNgachLuong = Request.Form[ParentID + "_sTenNgachLuong"];
            if (HamChung.Check_Trung(bang.TenBang, bang.TruongKhoa, iID_MaNgachLuong, "iID_MaNgachLuong", iID_MaNgachLuong, bang.DuLieuMoi))
            {
                arrLoi.Add("err_iID_MaNgachLuong", "Không được nhập trùng ký hiệu");
            }

            if (String.IsNullOrEmpty(iID_MaNgachLuong))
            {
                arrLoi.Add("err_iID_MaNgachLuong", "Bạn chưa nhập ký hiệu");
            }

            if (String.IsNullOrEmpty(sTenNgachLuong))
            {
                arrLoi.Add("err_sTenNgachLuong", "Bạn chưa nhập ngạch lương");
            }

            if (arrLoi.Count == 0)
            {
                bang.GiaTriKhoa = iID_MaNgachLuong;
                bang.Save();
                return RedirectToAction("Index", "Luong_DanhMucNgachLuong");
            }
            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_MaNgachLuong"] = iID_MaNgachLuong;
                ViewData["data"] = dicData["data"];
                return View(sViewPath + "Luong_DanhMucNgachLuong_Edit.aspx");
            }
        }
开发者ID:BMSProject2015,项目名称:BMS,代码行数:46,代码来源:Luong_DanhMucNgachLuongController.cs

示例10: EditSubmit

        public ActionResult EditSubmit(String ParentID, String iID_MaBangLuong)
        {
            String MaND = User.Identity.Name;
            string sChucNang = "Edit";
            if (Request.Form[ParentID + "_DuLieuMoi"] == "1" && LuongCongViecModel.NguoiDung_DuocThemChungTu(PhanHeModels.iID_MaPhanHeLuong, MaND) == false)
            {
                return RedirectToAction("Index", "PermitionMessage");
            }
            if (Request.Form[ParentID + "_DuLieuMoi"] == "1")
            {
                sChucNang = "Create";
            }
            String sTen = Convert.ToString(Request.Form[ParentID + "_sTen"]);
            Bang bang = new Bang("L_BangLuong");
            bang.MaNguoiDungSua = User.Identity.Name;
            bang.IPSua = Request.UserHostAddress;
            NameValueCollection arrLoi = bang.TruyenGiaTri(ParentID, Request.Form);

            int iThangLamViec = CauHinhLuongModels.LayThangLamViec(User.Identity.Name);
            int iNamLamViec = CauHinhLuongModels.LayNamLamViec(User.Identity.Name);
            String sDanhSachMaDonVi = Request.Form["iID_MaDonVi"] + ",";
            if (arrLoi.Count == 0)
            {
                String iID_MaBangLuongAddNew;
                bang.CmdParams.Parameters.AddWithValue("@iThangBangLuong", iThangLamViec);
                bang.CmdParams.Parameters.AddWithValue("@iNamBangLuong", iNamLamViec);
                bang.CmdParams.Parameters.AddWithValue("@sDanhSachMaDonVi", sDanhSachMaDonVi);
                bang.CmdParams.Parameters.AddWithValue("@iID_MaTrangThaiDuyet", LuongCongViecModel.Get_iID_MaTrangThaiDuyetMoi(PhanHeModels.iID_MaPhanHeLuong));
                iID_MaBangLuongAddNew= Convert.ToString(bang.Save());
                if (bang.DuLieuMoi)
                {
                    BangLuongChiTietModels.ThemChiTiet(iID_MaBangLuongAddNew, User.Identity.Name, Request.UserHostAddress, iNamLamViec);//Tinh luong tu danh sach can bo hoac tu thang truoc
                    LuongModels.InsertDuyetBangLuong(iID_MaBangLuongAddNew, "Tạo mới", User.Identity.Name, Request.UserHostAddress);
                }
                //return RedirectToAction("Index", "Luong_BangLuong", new { iNamBangLuong = iNamLamViec, iThangBangLuong = iThangLamViec});
                return RedirectToAction("Index", "Luong_BangLuongChiTiet", new { iID_MaBangLuong = iID_MaBangLuongAddNew});
            }
            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_MaBangLuong"] = iID_MaBangLuong;
                ViewData["data"] = dicData["data"];
                return View(sViewPath + "Luong_BangLuong_Edit.aspx");
            }
        }
开发者ID:BMSProject2015,项目名称:BMS,代码行数:50,代码来源:Luong_BangLuongController.cs

示例11: EditSubmit

        public ActionResult EditSubmit(String ParentID)
        {
            if (HamChung.CoQuyenXemTheoMenu(Request.Url.AbsolutePath, User.Identity.Name))
            {
                Bang bang = new Bang("KT_NhanVien");
                bang.MaNguoiDungSua = User.Identity.Name;
                bang.IPSua = Request.UserHostAddress;
                NameValueCollection arrLoi = bang.TruyenGiaTri(ParentID, Request.Form);

                String iID_MaNhanVien = Request.Form[ParentID + "_iID_MaNhanVien"];
                iID_MaNhanVien = iID_MaNhanVien.Trim();
                String sTen = Request.Form[ParentID + "_sTen"];
                if (HamChung.Check_Trung(bang.TenBang, bang.TruongKhoa, iID_MaNhanVien, "iID_MaNhanVien", iID_MaNhanVien,
                                         bang.DuLieuMoi))
                {
                    arrLoi.Add("err_iID_MaNhanVien", "Không được nhập trùng ký hiệu");
                }

                if (String.IsNullOrEmpty(iID_MaNhanVien))
                {
                    arrLoi.Add("err_iID_MaNhanVien", "Bạn chưa nhập mã nhân viên");
                }

                if (String.IsNullOrEmpty(sTen))
                {
                    arrLoi.Add("err_sTen", "Bạn chưa nhập tên nhân viên");
                }

                if (arrLoi.Count == 0)
                {
                    bang.GiaTriKhoa = iID_MaNhanVien;
                    bang.Save();
                    return RedirectToAction("Index", "KeToan_NhanVien");
                }
                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_MaNhanVien"] = iID_MaNhanVien;
                    ViewData["data"] = dicData["data"];
                    return View(sViewPath + "KeToan_NhanVien_Edit.aspx");
                }
            }
            else
            {
                return RedirectToAction("Index", "PermitionMessage");
            }
        }
开发者ID:BMSProject2015,项目名称:BMS,代码行数:54,代码来源:KeToan_NhanVienController.cs

示例12: EditSubmit

        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");
            }
        }
开发者ID:BMSProject2015,项目名称:BMS,代码行数:53,代码来源:Luong_DanhMucThamSoController.cs

示例13: EditSubmit

        public ActionResult EditSubmit(String ParentID, String iID_MaChuKy)
        {
            if (HamChung.CoQuyenXemTheoMenu(Request.Url.AbsolutePath, User.Identity.Name))
            {
                Bang bang = new Bang("NS_DanhMucChuKy");
                bang.MaNguoiDungSua = User.Identity.Name;
                bang.IPSua = Request.UserHostAddress;
                NameValueCollection arrLoi = bang.TruyenGiaTri(ParentID, Request.Form);

                String sKyHieu = Request.Form[ParentID + "_sKyHieu"];
                String sChuKy = Request.Form[ParentID + "_sChuKy"];
                if (HamChung.Check_Trung(bang.TenBang, bang.TruongKhoa, iID_MaChuKy, "sKyHieu", sKyHieu, bang.DuLieuMoi))
                {
                    arrLoi.Add("err_sKyHieu", "Không được nhập trùng ký hiệu");
                }

                if (arrLoi.Count == 0)
                {
                    bang.Save();
                    return RedirectToAction("Index", "DanhMucChuKy");
                }
                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_MaChuKy"] = iID_MaChuKy;
                    ViewData["data"] = dicData["data"];
                    return View(sViewPath + "DanhMucChuKy_Edit.aspx");
                }

            }
            else
            {
                return RedirectToAction("Index", "PermitionMessage");
            }
        }
开发者ID:BMSProject2015,项目名称:BMS,代码行数:42,代码来源:DanhMucChuKyController.cs

示例14: SortSubmit

 public ActionResult SortSubmit(String ControlID)
 {
     if (HamChung.CoQuyenXemTheoMenu(Request.Url.AbsolutePath, User.Identity.Name))
     {
         Bang bang = new Bang("DC_LoaiDanhMuc");
         bang.MaNguoiDungSua = User.Identity.Name;
         bang.IPSua = Request.UserHostAddress;
         NameValueCollection arrLoi = bang.TruyenGiaTri(ControlID, Request.Form);
         if (arrLoi.Count == 0)
         {
             //bang.Save();
             string strOrder = Request.Form["hiddenOrder"].ToString();
             SqlCommand cmd = new SqlCommand();
             cmd.CommandText = "Update_DanhMuc";
             cmd.CommandType = CommandType.StoredProcedure;
             cmd.Parameters.AddWithValue("@DanhMuc_Order", strOrder);
             Connection.UpdateDatabase(cmd);
             return RedirectToAction("Index");
         }
         else
         {
             for (int i = 0; i <= arrLoi.Count - 1; i++)
             {
                 ModelState.AddModelError(ControlID + "_" + arrLoi.GetKey(i), arrLoi[i]);
             }
             Dictionary<string, object> dicData = bang.LayGoiDuLieu(Request.Form, true);
             ViewData[bang.TenBang + "_dicData"] = dicData;
             return View(sViewPath + "Edit.aspx");
         }
     }
     else
     {
         return RedirectToAction("Index", "PermitionMessage");
     }
 }
开发者ID:BMSProject2015,项目名称:BMS,代码行数:35,代码来源:LoaiDanhMucController.cs

示例15: EditSubmit

 public ActionResult EditSubmit(String ControlID)
 {
     if (HamChung.CoQuyenXemTheoMenu(Request.Url.AbsolutePath, User.Identity.Name))
     {
         Bang bang = new Bang("DC_LoaiDanhMuc");
         bang.MaNguoiDungSua = User.Identity.Name;
         bang.IPSua = Request.UserHostAddress;
         NameValueCollection arrLoi = bang.TruyenGiaTri(ControlID, Request.Form);
         if (arrLoi.Count == 0)
         {
             bang.Save();
             return RedirectToAction("Index");
         }
         else
         {
             for (int i = 0; i <= arrLoi.Count - 1; i++)
             {
                 ModelState.AddModelError(ControlID + "_" + arrLoi.GetKey(i), arrLoi[i]);
             }
             Dictionary<string, object> dicData = bang.LayGoiDuLieu(Request.Form, true);
             ViewData[bang.TenBang + "_dicData"] = dicData;
             return View(sViewPath + "Edit.aspx");
         }
     }
     else
     {
         return RedirectToAction("Index", "PermitionMessage");
     }
 }
开发者ID:BMSProject2015,项目名称:BMS,代码行数:29,代码来源:LoaiDanhMucController.cs


注:本文中的Bang.LayGoiDuLieu方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。