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


C# Bang.Save方法代码示例

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


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

示例1: Edit_Fast_KhenThuong_Submit

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

示例2: Update_objVTNCC

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

示例3: EditSubmit

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

示例4: ChiTiet_Submit

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

示例5: EditSubmit

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

示例6: CapNhatBangDuyetChungTu

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

示例7: EditSubmit

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

示例8: CapNhatBanGhi

 /// <summary>
 /// cập nhật chứng từ
 /// </summary>
 /// <param name="iID_MaCapPhat"></param>
 /// <param name="Params"></param>
 /// <param name="sMaND"></param>
 /// <param name="sIPSua"></param>
 /// <returns></returns>
 public static Boolean CapNhatBanGhi(String iID_MaCapPhat, SqlParameterCollection Params, String sMaND, String sIPSua)
 {
     Bang bang = new Bang("CP_CapPhat");
     bang.MaNguoiDungSua = sMaND;
     bang.IPSua = sIPSua;
     bang.GiaTriKhoa = iID_MaCapPhat;
     bang.DuLieuMoi = false;
     for (int i = 0; i < Params.Count; i++)
     {
         bang.CmdParams.Parameters.AddWithValue(Params[i].ParameterName, Params[i].Value);
     }
     bang.Save();
     return false;
 }
开发者ID:BMSProject2015,项目名称:BMS,代码行数:22,代码来源:CapPhat_ChungTuModels.cs

示例9: CapNhapKichHoat

 public ActionResult CapNhapKichHoat(String MaNguoiDung, String MaNhomNguoiDung, Boolean HoatDong)
 {
     if (BaoMat.ChoPhepLamViec(User.Identity.Name, "QT_NguoiDung", "Edit") == false)
     {
         return RedirectToAction("Index", "PermitionMessage");
     }
     Bang bang = new Bang("QT_NguoiDung");
     bang.GiaTriKhoa = MaNguoiDung;
     bang.CmdParams.Parameters.AddWithValue("@bHoatDong", HoatDong);
     bang.DuLieuMoi = false;
     bang.Save();
     return RedirectToAction("List");
     //return RedirectToAction("Index", new { MaNhomNguoiDung = MaNhomNguoiDung });
 }
开发者ID:BMSProject2015,项目名称:BMS,代码行数:14,代码来源:NguoiDungController.cs

示例10: AddNewSubmit

        public ActionResult AddNewSubmit(String ParentID)
        {
            String MaDotRutDuToan = "";
            String sLNS = Convert.ToString(Request.Form[ParentID + "_sLNS"]);
            DataTable dtCauHinh = NguoiDungCauHinhModels.LayCauHinh(User.Identity.Name);
            String NamNganSach = Convert.ToString(dtCauHinh.Rows[0]["iID_MaNamNganSach"]);
            String NguonNganSach = Convert.ToString(dtCauHinh.Rows[0]["iID_MaNguonNganSach"]);
            String NamLamViec = Convert.ToString(dtCauHinh.Rows[0]["iNamLamViec"]);

            Bang bang = new Bang("KT_RutDuToanDot");
            bang.CmdParams.Parameters.AddWithValue("@iNamLamViec", NamLamViec);
            bang.CmdParams.Parameters.AddWithValue("@iID_MaNamNganSach", NamNganSach);
            bang.CmdParams.Parameters.AddWithValue("@iID_MaNguonNganSach", NguonNganSach);
            bang.MaNguoiDungSua = User.Identity.Name;
            bang.IPSua = Request.UserHostAddress;
            NameValueCollection arrLoi = bang.TruyenGiaTri(ParentID, Request.Form);

            String dNgayDotRutDuToan = Convert.ToString(Request.Form[ParentID + "_vidNgayDotRutDuToan"]);

            if (HamChung.isDate(dNgayDotRutDuToan) == false)
            {
                arrLoi.Add("err_dNgayDotRutDuToan", "Ngày không đúng");
            }
            DateTime d = Convert.ToDateTime(CommonFunction.LayNgayTuXau(dNgayDotRutDuToan));

            if (dNgayDotRutDuToan == string.Empty || dNgayDotRutDuToan == "" || dNgayDotRutDuToan == null)
            {
                arrLoi.Add("err_dNgayDotRutDuToan", "Bạn chưa nhập ngày!");
            }
            if (HamChung.Check_Trung("KT_RutDuToanDot", "iID_MaDotRutDuToan", Guid.Empty.ToString(), "dNgayDotRutDuToan", dNgayDotRutDuToan, true))
            {
                arrLoi.Add("err_dNgayDotRutDuToan", "Trùng đợt phân bổ");
            }

            if (arrLoi.Count > 0)
            {
                for (int i = 0; i <= arrLoi.Count - 1; i++)
                {
                    ModelState.AddModelError(ParentID + "_" + arrLoi.GetKey(i), arrLoi[i]);
                }
                ViewData["MaDotRutDuToan"] = MaDotRutDuToan;
                return View(sViewPath + "DotRutDuToan_Index.aspx");
            }
            else
            {
                MaDotRutDuToan = Convert.ToString(bang.Save());
                KeToan_RutDuToanDotModels.Save(MaDotRutDuToan, Request.UserHostAddress, User.Identity.Name);
                return RedirectToAction("Index", "KeToan_RutDuToan");
            }
        }
开发者ID:BMSProject2015,项目名称:BMS,代码行数:50,代码来源:KeToan_RutDuToanController.cs

示例11: CapNhapLenBangLuongChiTiet

        public static void CapNhapLenBangLuongChiTiet(String iID_MaBangLuongChiTiet, String UserID, String IPSua)
        {
            DataTable dtChiTiet = LuongModels.Get_ChiTietBangLuongChiTiet(iID_MaBangLuongChiTiet);
            DataTable dtChiTiet_PhuCap = LuongModels.Get_dtLuongPhuCap(iID_MaBangLuongChiTiet);
            Bang bang = new Bang("L_BangLuongChiTiet");
            bang.GiaTriKhoa = iID_MaBangLuongChiTiet;
            bang.DuLieuMoi = false;
            bang.MaNguoiDungSua = UserID;
            bang.IPSua = IPSua;
            for (int j = 0; j < dtChiTiet.Columns.Count; j++)
            {
                String TenTruong = dtChiTiet.Columns[j].ColumnName;
                if (TenTruong.StartsWith("rPhuCap_"))
                {
                    double rHeSo = 0;
                    String sMoTa = "";
                    double rTongTien = 0;
                    for (int i = 0; i < dtChiTiet_PhuCap.Rows.Count; i++)
                    {
                        if (Convert.ToString(dtChiTiet_PhuCap.Rows[i]["sMaTruongHeSo_BangLuong"]) == dtChiTiet.Columns[j].ColumnName)
                        {
                            rHeSo = Convert.ToDouble(dtChiTiet_PhuCap.Rows[i]["rHeSo"]);
                        }
                        if (Convert.ToString(dtChiTiet_PhuCap.Rows[i]["sMaTruongSoTien_BangLuong"]) == dtChiTiet.Columns[j].ColumnName)
                        {
                            rTongTien += Convert.ToDouble(dtChiTiet_PhuCap.Rows[i]["rSoTien"]);
                            if (sMoTa != "") sMoTa += ",";
                            sMoTa += Convert.ToString(dtChiTiet_PhuCap.Rows[i]["iID_MaPhuCap"]);
                        }
                    }
                    if (TenTruong.EndsWith("_HeSo"))
                    {
                        bang.CmdParams.Parameters.AddWithValue("@" + TenTruong, rHeSo);
                    }
                    else
                    {
                        bang.CmdParams.Parameters.AddWithValue("@" + TenTruong, rTongTien);
                        bang.CmdParams.Parameters.AddWithValue("@s" + TenTruong.Substring(1) + "_MoTa", sMoTa);
                    }
                }
            }
            bang.Save();

            dtChiTiet.Dispose();
            dtChiTiet_PhuCap.Dispose();
        }
开发者ID:BMSProject2015,项目名称:BMS,代码行数:46,代码来源:BangLuongChiTiet_PhuCapModels.cs

示例12: ThemDieuChuyenTaiSan

 public static void ThemDieuChuyenTaiSan(String iID_MaDonVi,String iID_MaTaiSan,String UserName,String IPSua)
 {
     if (CheckDonViSuDungTaiSan(iID_MaDonVi, iID_MaTaiSan) == false)
     {
         //update lại trường đang sử dụng=false của tài sản với các đơn vị khác
         SuaLaiTruong_DangSuDung(iID_MaTaiSan, false);
         //thêm mới
         Bang bang = new Bang("KTCS_TaiSan_DonVi");
         bang.DuLieuMoi = true;
         bang.MaNguoiDungSua = UserName;
         bang.IPSua = IPSua;
         bang.CmdParams.Parameters.AddWithValue("@iID_MaDonVi", iID_MaDonVi);
         bang.CmdParams.Parameters.AddWithValue("@iID_MaTaiSan", iID_MaTaiSan);
         bang.CmdParams.Parameters.AddWithValue("@bDangSuDung", 1);
         bang.Save();
     }
 }
开发者ID:BMSProject2015,项目名称:BMS,代码行数:17,代码来源:KTCS_TaiSan_DonViModels.cs

示例13: AddNewSubmit

 public ActionResult AddNewSubmit(String ParentID)
 {
     String ThemMoi = Request.Form[ParentID + "_iThemMoi"];
     if (ThemMoi == "on")
     {
         DataTable dtCauHinh = NguoiDungCauHinhModels.LayCauHinh(User.Identity.Name);
         String NamNganSach = Convert.ToString(dtCauHinh.Rows[0]["iID_MaNamNganSach"]);
         String NguonNganSach = Convert.ToString(dtCauHinh.Rows[0]["iID_MaNguonNganSach"]);
         String NamLamViec = Convert.ToString(dtCauHinh.Rows[0]["iNamLamViec"]);
         String sSoHopDong = Request.Form[ParentID + "_sSoHopDong"];
         String dNgayHopDong = Request.Form[ParentID + "_vidNgayHopDong"];
         String dNgayLap = Request.Form[ParentID + "_vidNgayLap"];
         String sNoiDung = Request.Form[ParentID + "_sNoiDung"];
         Bang bang = new Bang("QLDA_HopDong");
         bang.CmdParams.Parameters.AddWithValue("@iNamLamViec", NamLamViec);
         bang.MaNguoiDungSua = User.Identity.Name;
         bang.IPSua = Request.UserHostAddress;
         NameValueCollection arrLoi = bang.TruyenGiaTri(ParentID, Request.Form);
         if (sSoHopDong == null || sSoHopDong == "")
         {
             arrLoi.Add("err_sSoHopDong", "Bạn chưa nhập số hợp đồng!");
         }
         if (dNgayLap == null || dNgayLap == "")
         {
             arrLoi.Add("err_dNgayLap", "Bạn chưa nhập ngày lập!");
         }
         if (dNgayHopDong == null || dNgayHopDong == "")
         {
             arrLoi.Add("err_dNgayHopDong", "Bạn chưa nhập ngày hợp đồng!");
         }
         if (arrLoi.Count == 0)
         {
             bang.Save();
         }
         else
         {
             for (int i = 0; i <= arrLoi.Count - 1; i++)
             {
                 ModelState.AddModelError(ParentID + "_" + arrLoi.GetKey(i), arrLoi[i]);
             }
             ViewData["bThemMoi"] = true;
             return View(sViewPath + "QLDA_HopDong_List.aspx");
         }
     }
     return RedirectToAction("List", "QLDA_HopDong");
 }
开发者ID:BMSProject2015,项目名称:BMS,代码行数:46,代码来源:QLDA_HopDongController.cs

示例14: AddNewSubmit

        public ActionResult AddNewSubmit(String ParentID)
        {
            String ThemMoi = Request.Form[ParentID + "_iThemMoi"];
            if (ThemMoi == "on")
            {
                DataTable dtCauHinh = NguoiDungCauHinhModels.LayCauHinh(User.Identity.Name);
                String NamNganSach = Convert.ToString(dtCauHinh.Rows[0]["iID_MaNamNganSach"]);
                String NguonNganSach = Convert.ToString(dtCauHinh.Rows[0]["iID_MaNguonNganSach"]);
                String NamLamViec = Convert.ToString(dtCauHinh.Rows[0]["iNamLamViec"]);
                String dNgayDotNganSach = Request.Form[ParentID + "_vidNgayQuyetToan"];
                DateTime d = Convert.ToDateTime(CommonFunction.LayNgayTuXau(dNgayDotNganSach));
                Int32 iSoDot = 1;
                if (QLDA_QuyetToanModels.Get_Max_Dot(NamLamViec) != "")
                {
                    iSoDot = Convert.ToInt32(QLDA_QuyetToanModels.Get_Max_Dot(NamLamViec)) + 1;
                };

                Bang bang = new Bang("QLDA_QuyetToan_SoPhieu");
                bang.CmdParams.Parameters.AddWithValue("@iNamLamViec", NamLamViec);
                bang.CmdParams.Parameters.AddWithValue("@iSoQuyetToan", iSoDot);
                bang.MaNguoiDungSua = User.Identity.Name;
                bang.IPSua = Request.UserHostAddress;
                NameValueCollection arrLoi = bang.TruyenGiaTri(ParentID, Request.Form);
                if (dNgayDotNganSach == null || dNgayDotNganSach == "")
                {
                    arrLoi.Add("err_dNgayQuyetToan", "Trùng đợt quyết toán");
                }
                if (arrLoi.Count == 0)
                {
                    bang.Save();
                }
                else
                {
                    for (int i = 0; i <= arrLoi.Count - 1; i++)
                    {
                        ModelState.AddModelError(ParentID + "_" + arrLoi.GetKey(i), arrLoi[i]);
                    }
                    ViewData["bThemMoi"] = true;
                    return View(sViewPath + "QLDA_QuyetToan_Dot_Index.aspx");
                }
            }
            return RedirectToAction("Index", "QLDA_QuyetToan");
        }
开发者ID:BMSProject2015,项目名称:BMS,代码行数:43,代码来源:QLDA_QuyetToanController.cs

示例15: EditSubmit

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

            if (!bang.DuLieuMoi)
            {
                bang.GiaTriKhoa = iID_MaNhaCungCap;
            }
            else if (iID_MaDonViDangNhap != "-1")
            {
                bang.CmdParams.Parameters.AddWithValue("@iID_MaDonVi", iID_MaDonViDangNhap);
            }
            bang.Save();

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


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