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


C# SqlParameterCollection.IndexOf方法代码示例

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


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

示例1: ThemThongTinChiTietTaiChinhDoanhNghiepLayTruongTien

        public static void ThemThongTinChiTietTaiChinhDoanhNghiepLayTruongTien(DataRow RMucLucChiTieu, SqlParameterCollection Params)
        {
            //<--Thêm tham số từ bảng MucLucNganSach
            String strDSTruong = "iID_MaDoanhNghiep,sTenDoanhNghiep";
            String[] arrDSTruong = strDSTruong.Split(',');

            for (int i = 0; i < arrDSTruong.Length; i++)
            {
                if (Params.IndexOf("@" + arrDSTruong[i]) >= 0)
                {
                    Params["@" + arrDSTruong[i]].Value = RMucLucChiTieu[arrDSTruong[i]];
                }
                else
                {
                    Params.AddWithValue("@" + arrDSTruong[i], RMucLucChiTieu[arrDSTruong[i]]);
                }
            }
        }
开发者ID:BMSProject2015,项目名称:BMS,代码行数:18,代码来源:TCDN_BaoCaoTaiChinhModels.cs

示例2: ThemThongTinChiTietTaiChinhDoanhNghiepLayTruongTien

        public static void ThemThongTinChiTietTaiChinhDoanhNghiepLayTruongTien(DataRow RMucLucChiTieu, DataTable dtDauKy, SqlParameterCollection Params)
        {
            //<--Thêm tham số từ bảng MucLucNganSach
            String strDSTruong = "sKyHieu,sTen,sThuyetMinh";
            String sXauNoiMa = "";
            String[] arrDSTruong = strDSTruong.Split(',');
            if (Params.IndexOf("@iID_MaChiTieu") >= 0)
            {
                Params["@iID_MaChiTieu"].Value = RMucLucChiTieu["iID_MaChiTieu"];
                Params["@iID_MaChiTieu_Cha"].Value = RMucLucChiTieu["iID_MaChiTieu_Cha"];
                Params["@bLaHangCha"].Value = RMucLucChiTieu["bLaHangCha"];
            }
            else
            {
                Params.AddWithValue("@iID_MaChiTieu", RMucLucChiTieu["iID_MaChiTieu"]);
                Params.AddWithValue("@iID_MaChiTieu_Cha", RMucLucChiTieu["iID_MaChiTieu_Cha"]);
                Params.AddWithValue("@bLaHangCha", RMucLucChiTieu["bLaHangCha"]);
            }
            String iID_MaChiTieu = Convert.ToString(RMucLucChiTieu["iID_MaChiTieu"]);
            String iID_MaChiTieu1 = "";
            for (int i = 0; i < dtDauKy.Rows.Count; i++)
            {
                iID_MaChiTieu1 = Convert.ToString(dtDauKy.Rows[i]["iID_MaChiTieu"]);
                if (iID_MaChiTieu.Equals(iID_MaChiTieu1))
                {
                    if (Params.IndexOf("@rSoDauNam") >= 0)
                    {
                        Params["@rSoDauNam"].Value = dtDauKy.Rows[i]["rSoCuoiNam"];
                    }
                    else
                    {
                        Params.AddWithValue("@rSoDauNam", dtDauKy.Rows[i]["rSoCuoiNam"]);
                    }
                    dtDauKy.Rows.RemoveAt(i);
                    break;
                }
            }

            for (int i = 0; i < arrDSTruong.Length; i++)
            {
                if (Params.IndexOf("@" + arrDSTruong[i]) >= 0)
                {
                    Params["@" + arrDSTruong[i]].Value = RMucLucChiTieu[arrDSTruong[i]];
                }
                else
                {
                    Params.AddWithValue("@" + arrDSTruong[i], RMucLucChiTieu[arrDSTruong[i]]);
                }
                if (i < arrDSTruong.Length - 1 && String.IsNullOrEmpty(Convert.ToString(RMucLucChiTieu[arrDSTruong[i]])) == false)
                {
                    if (sXauNoiMa != "") sXauNoiMa += "-";
                    sXauNoiMa += Convert.ToString(RMucLucChiTieu[arrDSTruong[i]]);
                }
            }
            if (Params.IndexOf("@sXauNoiMa") >= 0)
            {
                Params["@sXauNoiMa"].Value = sXauNoiMa;
            }
            else
            {
                Params.AddWithValue("@sXauNoiMa", sXauNoiMa);
            }
        }
开发者ID:BMSProject2015,项目名称:BMS,代码行数:63,代码来源:TCDN_ChungTuChiTietModels.cs

示例3: ThemThongTinChiTietTaiChinhDoanhNghiepLayTruongTien

        public static void ThemThongTinChiTietTaiChinhDoanhNghiepLayTruongTien(DataRow RMucLucChiTieu, DataTable dtDauKy, SqlParameterCollection Params)
        {
            //<--Thêm tham số từ bảng MucLucNganSach
            String strDSTruong = "sKyHieu,sTen,sMaSoBangCanDoi";
            String[] arrDSTruong = strDSTruong.Split(',');
            if (Params.IndexOf("@iID_MaChiTieuHoSo") >= 0)
            {
                Params["@iID_MaChiTieuHoSo"].Value = RMucLucChiTieu["iID_MaChiTieuHoSo"];
                Params["@iID_MaChiTieuHoSo_Cha"].Value = RMucLucChiTieu["iID_MaChiTieuHoSo_Cha"];
                Params["@bLaHangCha"].Value = RMucLucChiTieu["bLaHangCha"];
            }
            else
            {
                Params.AddWithValue("@iID_MaChiTieuHoSo", RMucLucChiTieu["iID_MaChiTieuHoSo"]);
                Params.AddWithValue("@iID_MaChiTieuHoSo_Cha", RMucLucChiTieu["iID_MaChiTieuHoSo_Cha"]);
                Params.AddWithValue("@bLaHangCha", RMucLucChiTieu["bLaHangCha"]);
            }
            for (int i = 0; i < arrDSTruong.Length; i++)
            {
                if (Params.IndexOf("@" + arrDSTruong[i]) >= 0)
                {
                    Params["@" + arrDSTruong[i]].Value = RMucLucChiTieu[arrDSTruong[i]];
                }
                else
                {
                    Params.AddWithValue("@" + arrDSTruong[i], RMucLucChiTieu[arrDSTruong[i]]);
                }
            }

            //Lấy dữ liệu từ quý trước
            String iID_MaChiTieu = Convert.ToString(RMucLucChiTieu["iID_MaChiTieuHoSo"]);
            String iID_MaChiTieu1 = "";
            for (int i = 0; i < dtDauKy.Rows.Count; i++)
            {
                iID_MaChiTieu1 = Convert.ToString(dtDauKy.Rows[i]["iID_MaChiTieuHoSo"]);
                if (iID_MaChiTieu.Equals(iID_MaChiTieu1))
                {
                    if (Params.IndexOf("@rKyTruocChuyenSang") >= 0)
                    {
                        Params["@rKyTruocChuyenSang"].Value = dtDauKy.Rows[i]["rSoConNoCuoiKy"];
                    }
                    else
                    {
                        Params.AddWithValue("@rKyTruocChuyenSang", dtDauKy.Rows[i]["rSoConNoCuoiKy"]);
                    }
                    dtDauKy.Rows.RemoveAt(i);
                    break;
                }
            }
            //End Lấy dữ liệu từ quý trước
        }
开发者ID:BMSProject2015,项目名称:BMS,代码行数:51,代码来源:TCDN_ChiTieuThuNopModels.cs

示例4: ThemThongTinCuaMucLucNganSach

 public static void ThemThongTinCuaMucLucNganSach(DataRow RMucLucNganSach, SqlParameterCollection Params)
 {
     //<--Thêm tham số từ bảng MucLucNganSach
     //String[] arrDSDuocNhapTruongTien = MucLucNganSachModels.strDSDuocNhapTruongTien.Split(',');
     String[] arrDSTruong = MucLucNganSachModels.strDSTruong.Split(',');
     String sXauNoiMa = "";
     if (Params.IndexOf("@iID_MaMucLucNganSach") >= 0)
     {
         Params["@iID_MaMucLucNganSach"].Value = RMucLucNganSach["iID_MaMucLucNganSach"];
         Params["@iID_MaMucLucNganSach_Cha"].Value = RMucLucNganSach["iID_MaMucLucNganSach_Cha"];
         Params["@bLaHangCha"].Value = RMucLucNganSach["bLaHangCha"];
     }
     else
     {
         Params.AddWithValue("@iID_MaMucLucNganSach", RMucLucNganSach["iID_MaMucLucNganSach"]);
         Params.AddWithValue("@iID_MaMucLucNganSach_Cha", RMucLucNganSach["iID_MaMucLucNganSach_Cha"]);
         Params.AddWithValue("@bLaHangCha", RMucLucNganSach["bLaHangCha"]);
     }
     //for (int i = 0; i < arrDSDuocNhapTruongTien.Length; i++)
     //{
     //    if (Params.IndexOf("@" + arrDSDuocNhapTruongTien[i]) >= 0)
     //    {
     //        Params["@" + arrDSDuocNhapTruongTien[i]].Value = RMucLucNganSach[arrDSDuocNhapTruongTien[i]];
     //    }
     //    else
     //    {
     //        Params.AddWithValue("@" + arrDSDuocNhapTruongTien[i], RMucLucNganSach[arrDSDuocNhapTruongTien[i]]);
     //    }
     //}
     for (int i = 0; i < arrDSTruong.Length; i++)
     {
         if (Params.IndexOf("@" + arrDSTruong[i]) >= 0)
         {
             Params["@" + arrDSTruong[i]].Value = RMucLucNganSach[arrDSTruong[i]];
         }
         else
         {
             Params.AddWithValue("@" + arrDSTruong[i], RMucLucNganSach[arrDSTruong[i]]);
         }
         if (i < arrDSTruong.Length - 1 && String.IsNullOrEmpty(Convert.ToString(RMucLucNganSach[arrDSTruong[i]])) == false)
         {
             if (sXauNoiMa != "") sXauNoiMa += "-";
             sXauNoiMa += Convert.ToString(RMucLucNganSach[arrDSTruong[i]]);
         }
     }
     if (Params.IndexOf("@sXauNoiMa") >= 0)
     {
         Params["@sXauNoiMa"].Value = sXauNoiMa;
     }
     else
     {
         Params.AddWithValue("@sXauNoiMa", sXauNoiMa);
     }
 }
开发者ID:BMSProject2015,项目名称:BMS,代码行数:54,代码来源:BaoHiem_ChungTuChiChiTietModels.cs

示例5: ThemThongTinMucLucNganSach_CoTruongTien

        public static void ThemThongTinMucLucNganSach_CoTruongTien(DataRow RMucLucNganSach, SqlParameterCollection Params,DataTable dt,Boolean DonViChoPhanBo=false)
        {
            //<--Thêm tham số từ bảng MucLucNganSach
            String[] arrDSDuocNhapTruongTien = MucLucNganSachModels.strDSDuocNhapTruongTien.Split(',');
            String[] arrDSTruong = MucLucNganSachModels.strDSTruong.Split(',');
            String[] arrTruongTienSo = MucLucNganSachModels.strDSTruongTien_So.Split(',');
            String sXauNoiMa = "";
            if (Params.IndexOf("@iID_MaMucLucNganSach") >= 0)
            {
                Params["@iID_MaMucLucNganSach"].Value = RMucLucNganSach["iID_MaMucLucNganSach"];
                Params["@iID_MaMucLucNganSach_Cha"].Value = RMucLucNganSach["iID_MaMucLucNganSach_Cha"];
                Params["@bLaHangCha"].Value = RMucLucNganSach["bLaHangCha"];
            }
            else
            {
                Params.AddWithValue("@iID_MaMucLucNganSach", RMucLucNganSach["iID_MaMucLucNganSach"]);
                Params.AddWithValue("@iID_MaMucLucNganSach_Cha", RMucLucNganSach["iID_MaMucLucNganSach_Cha"]);
                Params.AddWithValue("@bLaHangCha", RMucLucNganSach["bLaHangCha"]);
            }
            for (int i = 0; i < arrDSDuocNhapTruongTien.Length; i++)
            {
                if (Params.IndexOf("@" + arrDSDuocNhapTruongTien[i]) >= 0)
                {
                    Params["@" + arrDSDuocNhapTruongTien[i]].Value = RMucLucNganSach[arrDSDuocNhapTruongTien[i]];
                }
                else
                {
                    Params.AddWithValue("@" + arrDSDuocNhapTruongTien[i], RMucLucNganSach[arrDSDuocNhapTruongTien[i]]);
                }
            }
            for (int i = 0; i < arrDSTruong.Length; i++)
            {
                if (Params.IndexOf("@" + arrDSTruong[i]) >= 0)
                {
                    Params["@" + arrDSTruong[i]].Value = RMucLucNganSach[arrDSTruong[i]];
                }
                else
                {
                    Params.AddWithValue("@" + arrDSTruong[i], RMucLucNganSach[arrDSTruong[i]]);
                }
                if (i < arrDSTruong.Length - 1 && String.IsNullOrEmpty(Convert.ToString(RMucLucNganSach[arrDSTruong[i]])) == false)
                {
                    if (sXauNoiMa != "") sXauNoiMa += "-";
                    sXauNoiMa += Convert.ToString(RMucLucNganSach[arrDSTruong[i]]);
                }
            }
            if (DonViChoPhanBo==false)
            {
                for (int j = 0; j < dt.Rows.Count; j++)
                {
                    string sXauNoiMa1 = Convert.ToString(dt.Rows[j]["sXauNoiMa"]);
                    if (sXauNoiMa == sXauNoiMa1)
                    {
                        for (int i = 0; i < arrTruongTienSo.Length; i++)
                        {
                            if (Params.IndexOf("@" + arrTruongTienSo[i]) >= 0)
                            {
                                Params["@" + arrTruongTienSo[i]].Value = dt.Rows[j][arrTruongTienSo[i]];
                                Params["@" + arrTruongTienSo[i]+"_ChiTieu"].Value = dt.Rows[j][arrTruongTienSo[i]];
                            }
                            else
                            {
                                Params.AddWithValue("@" + arrTruongTienSo[i], dt.Rows[j][arrTruongTienSo[i]]);
                                Params.AddWithValue("@" + arrTruongTienSo[i] + "_ChiTieu", dt.Rows[j][arrTruongTienSo[i]]);
                            }
                        }
                        break;
                    }
                    else
                    {
                        for (int i = 0; i < arrTruongTienSo.Length; i++)
                        {
                            if (Params.IndexOf("@" + arrTruongTienSo[i]) >= 0)
                            {
                                Params["@" + arrTruongTienSo[i]].Value = 0;
                                Params["@" + arrTruongTienSo[i] + "_ChiTieu"].Value = 0;
                            }
                            else
                            {
                                Params.AddWithValue("@" + arrTruongTienSo[i], 0);
                                Params.AddWithValue("@" + arrTruongTienSo[i]+"_ChiTieu", 0);
                            }
                        }
                    }
                }
            }
            else
            {

                for (int i = 0; i < arrTruongTienSo.Length; i++)
                {
                    if (Params.IndexOf("@" + arrTruongTienSo[i]) >= 0)
                    {
                        Params["@" + arrTruongTienSo[i]].Value =Convert.ToInt64(RMucLucNganSach[arrTruongTienSo[i]+"_DuToan"])*(-1);
                      //  Params["@" + arrTruongTienSo[i]].Value = 0;
                        Params["@" + arrTruongTienSo[i]+"_ChiTieu"].Value = 0;
                    }
                    else
                    {
                        Params.AddWithValue("@" + arrTruongTienSo[i], Convert.ToInt64(RMucLucNganSach[arrTruongTienSo[i]+"_DuToan"])*(-1));
//.........这里部分代码省略.........
开发者ID:BMSProject2015,项目名称:BMS,代码行数:101,代码来源:PhanBo_PhanBoChiTietModels.cs

示例6: ThemThongTinChiTiet

        public static void ThemThongTinChiTiet(DataRow RMucLucChiTieu,DataTable dtNamTruoc, SqlParameterCollection Params)
        {
            //<--Thêm tham số từ bảng MucLucNganSach
            String strDSTruong = "iID_MaDoanhNghiep,sTenDoanhNghiep";
            String[] arrDSTruong = strDSTruong.Split(',');

            for (int i = 0; i < arrDSTruong.Length; i++)
            {
                if (Params.IndexOf("@" + arrDSTruong[i]) >= 0)
                {
                    Params["@" + arrDSTruong[i]].Value = RMucLucChiTieu[arrDSTruong[i]];
                }
                else
                {
                    Params.AddWithValue("@" + arrDSTruong[i], RMucLucChiTieu[arrDSTruong[i]]);
                }
            }
            String iID_MaDoanhNghiep = Convert.ToString(RMucLucChiTieu["iID_MaDoanhNghiep"]);
            String iID_MaDoanhNghiep1 = "";
            for (int i = 0; i < dtNamTruoc.Rows.Count; i++)
            {
                iID_MaDoanhNghiep1 =Convert.ToString(dtNamTruoc.Rows[i]["iID_MaDoanhNghiep"]);
                if (iID_MaDoanhNghiep.Equals(iID_MaDoanhNghiep1))
                {
                    for (int j = 0; j < arrDanhSachTruongTien_NT.Length; j++)
                    {
                        if (Params.IndexOf("@" + arrDanhSachTruongTien_NT[i]) >= 0)
                        {
                            Params["@" + arrDanhSachTruongTien_NT[i]].Value = dtNamTruoc.Rows[i][arrDSTruong[j]];
                        }
                        else
                        {
                            Params.AddWithValue("@" + arrDanhSachTruongTien_NT[i], dtNamTruoc.Rows[i][arrDSTruong[j]]);
                        }
                    }
                    dtNamTruoc.Rows.RemoveAt(i);
                    break;
                }
            }
        }
开发者ID:BMSProject2015,项目名称:BMS,代码行数:40,代码来源:TCDN_BaoCaoTongHopModels.cs

示例7: ThemThongTinChiTietTaiChinhDoanhNghiepLayTruongTien

 public static void ThemThongTinChiTietTaiChinhDoanhNghiepLayTruongTien(DataRow RMucLucChiTieu, SqlParameterCollection Params)
 {
     //<--Thêm tham số từ bảng MucLucNganSach
     String strDSTruong = "sKyHieu,sTen,sDonViTinh";
     String sXauNoiMa = "";
     String[] arrDSTruong = strDSTruong.Split(',');
     if (Params.IndexOf("@iID_MaChiTieuHoSo") >= 0)
     {
         Params["@iID_MaChiTieuHoSo"].Value = RMucLucChiTieu["iID_MaChiTieuHoSo"];
         Params["@iID_MaChiTieuHoSo_Cha"].Value = RMucLucChiTieu["iID_MaChiTieuHoSo_Cha"];
         Params["@bLaHangCha"].Value = RMucLucChiTieu["bLaHangCha"];
     }
     else
     {
         Params.AddWithValue("@iID_MaChiTieuHoSo", RMucLucChiTieu["iID_MaChiTieuHoSo"]);
         Params.AddWithValue("@iID_MaChiTieuHoSo_Cha", RMucLucChiTieu["iID_MaChiTieuHoSo_Cha"]);
         Params.AddWithValue("@bLaHangCha", RMucLucChiTieu["bLaHangCha"]);
     }
     for (int i = 0; i < arrDSTruong.Length; i++)
     {
         if (Params.IndexOf("@" + arrDSTruong[i]) >= 0)
         {
             Params["@" + arrDSTruong[i]].Value = RMucLucChiTieu[arrDSTruong[i]];
         }
         else
         {
             Params.AddWithValue("@" + arrDSTruong[i], RMucLucChiTieu[arrDSTruong[i]]);
         }
         if (i < arrDSTruong.Length - 1 && String.IsNullOrEmpty(Convert.ToString(RMucLucChiTieu[arrDSTruong[i]])) == false)
         {
             if (sXauNoiMa != "") sXauNoiMa += "-";
             sXauNoiMa += Convert.ToString(RMucLucChiTieu[arrDSTruong[i]]);
         }
     }
     if (Params.IndexOf("@sXauNoiMa") >= 0)
     {
         Params["@sXauNoiMa"].Value = sXauNoiMa;
     }
     else
     {
         Params.AddWithValue("@sXauNoiMa", sXauNoiMa);
     }
 }
开发者ID:BMSProject2015,项目名称:BMS,代码行数:43,代码来源:TCDN_HoSoDoanhNghiepModels.cs


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