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"); } }
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"); } }
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"); } }
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"); } }
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"); } }
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"); } }
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"); } }
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) { 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"); } }
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"); } }
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"); } }
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 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"); } }
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"); } }
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"); } }
public ActionResult EditSubmit(String ParentID) { if (HamChung.CoQuyenXemTheoMenu(Request.Url.AbsolutePath, User.Identity.Name)) { Bang bang = new Bang("KTKB_NgoaiTe"); bang.MaNguoiDungSua = User.Identity.Name; bang.IPSua = Request.UserHostAddress; NameValueCollection arrLoi = bang.TruyenGiaTri(ParentID, Request.Form); String iID_MaNhanVien = Request.Form[ParentID + "_iID_MaNgoaiTe"]; iID_MaNhanVien = iID_MaNhanVien.Trim(); String sTen = Request.Form[ParentID + "_sTen"]; String rTyGia = Request.Form[ParentID + "_rTyGia"]; if (HamChung.Check_Trung(bang.TenBang, bang.TruongKhoa, iID_MaNhanVien, "iID_MaNgoaiTe", 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ã ngoại tệ"); } if (String.IsNullOrEmpty(sTen)) { arrLoi.Add("err_sTen", "Bạn chưa nhập tên ngoại tệ"); } if (String.IsNullOrEmpty(rTyGia)) { arrLoi.Add("err_rTyGia", "Bạn chưa nhập tỷ giá"); } if (arrLoi.Count == 0) { bang.MaNguoiDungSua = User.Identity.Name; bang.IPSua = Request.UserHostAddress; bang.TruyenGiaTri(ParentID, Request.Form); if (!String.IsNullOrEmpty(iID_MaNhanVien)) { String MaND = User.Identity.Name; DataTable dtCauHinh = NguoiDungCauHinhModels.LayCauHinh(MaND); int iNam = DateTime.Now.Year; int iThang = DateTime.Now.Month; if (dtCauHinh.Rows.Count > 0 && dtCauHinh!=null) { iNam = Convert.ToInt32(dtCauHinh.Rows[0]["iNamLamViec"]); iThang = Convert.ToInt32(dtCauHinh.Rows[0]["iThangLamViec"]); } if (dtCauHinh!=null) { dtCauHinh.Dispose(); } bang.CmdParams.Parameters.AddWithValue("@iID_MaNgoaiTe", iID_MaNhanVien); bang.CmdParams.Parameters.AddWithValue("@iNamLamViec", iNam); bang.CmdParams.Parameters.AddWithValue("@iThangLamViec", iThang); } else { bang.GiaTriKhoa = iID_MaNhanVien; } bang.Save(); return RedirectToAction("Index", "KeToan_NgoaiTe"); } 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_NgoaiTe_Edit.aspx"); } } else { return RedirectToAction("Index", "PermitionMessage"); } }