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


C# ListDictionary.Add方法代码示例

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


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

示例1: gridHistoricData_RowCommand

    protected void gridHistoricData_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        try {
            if (e.CommandName == "Insert") {
                string[] fields = { "Date", "CASH", "COMM", "GLEQ", "HEDG", "LOSH", "PREQ" };
                ListDictionary listDictionary = new ListDictionary();

                foreach (var f in fields) {
                    string boxName = "text" + f + "Add";
                    TextBox textBox = (TextBox)gridHistoricData.FooterRow.FindControl(boxName);
                    if (f == "Date") {
                        DateTime dt = DateTime.Parse(textBox.Text);
                        listDictionary.Add(f, dt);
                    } else {
                        double db = Double.Parse(textBox.Text);
                        listDictionary.Add(f, db);
                    }
                    textBox.Text = String.Empty;
                }

                sourceHistoricData.Insert(listDictionary);
                gridHistoricData.DataBind();
            }
        } catch (Exception ex) {
            showException(ex, labelException, "adding the asset class prices");
        }
    }
开发者ID:garsiden,项目名称:Report-Generator,代码行数:27,代码来源:editA-M.aspx.cs

示例2: submitButton_Click

    // Submit Button adds a new guestbook entry to the database,
    // clears the form and displays the updated list of guestbook entries
    protected void submitButton_Click( object sender, EventArgs e )
    {
        // create dictionary of parameters for inserting
          ListDictionary insertParameters = new ListDictionary();

          // add current date and the user's name, e-mail address
          // and message to dictionary of insert parameters
          insertParameters.Add( "Date", DateTime.Now.ToShortDateString() );
          insertParameters.Add( "Name", nameTextBox.Text );
          insertParameters.Add( "Email", emailTextBox.Text );
          insertParameters.Add( "Message1", messageTextBox.Text );

          // execute an INSERT LINQ statement to add a new entry to the
          // Messages table in the Guestbook data context that contains the
          // current date and the user's name, e-mail address and message
          messagesLinqDataSource.Insert( insertParameters );

          // clear the TextBoxes
          nameTextBox.Text = String.Empty;
          emailTextBox.Text = String.Empty;
          messageTextBox.Text = String.Empty;

          // update the GridView with the new database table contents
          messagesGridView.DataBind();
    }
开发者ID:Kazempour,项目名称:src,代码行数:27,代码来源:Guestbook.aspx.cs

示例3: getNguoiDung

 public DataTable getNguoiDung(clsNguoiDung_DTO nguoidungDTO)
 {
     ListDictionary _list = new ListDictionary();
     _list.Add("TenDangNhap", nguoidungDTO.TenDangNhap);
     _list.Add("MaDiemThi", nguoidungDTO.MaDiemThi);
     _list.Add("MatKhau", nguoidungDTO.MatKhau);
     _list.Add("Ho", nguoidungDTO.Ho);
     _list.Add("Ten", nguoidungDTO.Ten);
     _list.Add("CMND", nguoidungDTO.CMND);
     _list.Add("NgaySinh", nguoidungDTO.NgaySinh);
     _list.Add("DiaChi", nguoidungDTO.DiaChi);
     _list.Add("DienThoai", nguoidungDTO.DienThoai);
     _list.Add("Email", nguoidungDTO.Email);
     _list.Add("NgayDK", nguoidungDTO.NgayDK);
     _list.Add("TrangThai", nguoidungDTO.TrangThai);
     _list.Add("MaNhom", nguoidungDTO.MaNhom);
     DataTable dt = new DataTable();
     try
     {
         dt = obj.GetDataTable("Select_Nguoi_Dung",_list, CommandType.StoredProcedure);
     }
     catch
     {
         dt = null;
     }
     return dt;
 }
开发者ID:giangpc9x,项目名称:quanlygtproject,代码行数:27,代码来源:clsNguoiDung_DAL.cs

示例4: CustomerAccountService

        public CustomerAccountService()
        {
            customerAccounts = new ListDictionary<int, CustomerAccount>();

            customerAccounts.Add(1, new CustomerAccount(123456781, "Checking", 1842.75M));
            customerAccounts.Add(1, new CustomerAccount(123456782, "Savings", 9367.92M));

            customerAccounts.Add(2, new CustomerAccount(987654321, "Interest Checking", 2496.44M));
            customerAccounts.Add(2, new CustomerAccount(987654322, "Money Market", 21959.38M));
            customerAccounts.Add(2, new CustomerAccount(987654323, "Car Loan", -19483.95M));
        }
开发者ID:BackupTheBerlios,项目名称:sofia-svn,代码行数:11,代码来源:customeraccountservice.cs

示例5: Check_Login

 public int Check_Login(string strTenDangNhap, string strKhauKhau)
 {
     try
      {
          ListDictionary _list = new ListDictionary();
          _list.Add("TenDangNhap", strTenDangNhap);
          _list.Add("MatKhau", strKhauKhau);
          int iReturn = obj.ExcSql("[Check_Login]", _list, CommandType.StoredProcedure);
          return iReturn;
      }
      catch (Exception)
      {
          return -1111;
      }
 }
开发者ID:giangpc9x,项目名称:quanlygtproject,代码行数:15,代码来源:clsNguoiDung_DAL.cs

示例6: FindSpriteNamesInAllScene

    public static void FindSpriteNamesInAllScene()
    {
        ListDictionary<string, string> spriteNames = new ListDictionary<string, string>();

        string[] scenes = (from scene in EditorBuildSettings.scenes where scene.enabled select scene.path).ToArray();
        foreach (string scene in scenes)
        {
            EditorApplication.OpenScene(scene);

            Transform[] allTrnasforms = GameObject.FindObjectsOfType<Transform>();
            foreach (Transform transform in allTrnasforms)
            {
                UISprite sprite = transform.GetComponent<UISprite>();
                if (sprite != null && !spriteNames.ContainsValue(scene, sprite.spriteName))
                    spriteNames.Add(scene, sprite.spriteName);
            }
        }

        string log = string.Empty;
        foreach (string scene in scenes)
        {
            if (!spriteNames.ContainsKey(scene))
                continue;

            log += string.Format("Scene : {0}\n", scene);

            string spriteNameInScene = string.Empty;
            foreach (string spriteName in spriteNames[scene])
                spriteNameInScene += string.Format("{0}\n", spriteName);

            log += string.Format("{0}\n\n", spriteNameInScene);
        }

        Debug.LogWarning(log);
    }
开发者ID:honi90,项目名称:FindAllSpritesInScene,代码行数:35,代码来源:FindSprite.cs

示例7: Delete

 public int Delete(clsCTQuyen_DTO ctqDTO)
 {
     try
     {
         ListDictionary _list = new ListDictionary();
         _list.Add("MaQuyen", ctqDTO.MaQuyen);
         _list.Add("MaNhom", ctqDTO.MaQuyen);
         int iReturn = obj.ExcSql("Delete_CT_Quyen", _list, CommandType.StoredProcedure);
         return iReturn;
     }
     catch (Exception)
     {
         //return ex.Message;
         return -1111;
     }
 }
开发者ID:giangpc9x,项目名称:quanlygtproject,代码行数:16,代码来源:clsCTQuyen_DAL.cs

示例8: getcauluachon_cauhoi

 //lay cau lua chon theo cau hoi
 public DataTable getcauluachon_cauhoi(string MaCauHoi)
 {
     //DataTable dt_dethi1 = new DataTable();
     DataTable dt_cauhoi_cauluachon = new DataTable();
     try
     {
        // dt_dethi1 = obj.GetDataTable("select top 0 * from View_cauhoi_cauluachon", CommandType.Text);
        // dt_cauhoi_cauluachon = obj.GetDataTable("Select_cauluachontheocauhoi", //getcauluachon_cauhoi(MaCauHoi);
         //foreach (DataRow dr in dt_cauhoi_cauluachon.Rows)
         //{
             ListDictionary _list = new ListDictionary();
             _list.Add("MaCauHoi", MaCauHoi);
         //    _list.Add("NoiDung", dr["NoiDung"].ToString());
         //    _list.Add("HinhAnh", dr["HinhAnh"].ToString());
         //    _list.Add("NoiDungCLC", dr["NoiDungCLC"].ToString());
         //    //_list.Add("NoiDung", dr["NoiDung"].ToString());
             dt_cauhoi_cauluachon = obj.GetDataTable("Select_cauluachontheocauhoi", _list, CommandType.StoredProcedure);
            //for (int i = 0; i < dt_cauhoi_cauluachon.Rows.Count; i++)
            // {
            //     DataRow drDeThi = dt_dethi1.NewRow();
            //     drDeThi["MaCauHoi"] = dt_cauhoi_cauluachon.Rows[i]["MaCauHoi"];
            //     drDeThi["NoiDung"] = dt_cauhoi_cauluachon.Rows[i]["NoiDung"];
            //     drDeThi["HinhAnh"] = dt_cauhoi_cauluachon.Rows[i]["HinhAnh"];
            //     drDeThi["NoiDungCLC"] = dt_cauhoi_cauluachon.Rows[i]["NoiDungCLC"];
            //     dt_dethi1.Rows.Add(drDeThi);
            // }
         }
     //}
     catch
     {
         dt_cauhoi_cauluachon = null;
     }
     return dt_cauhoi_cauluachon;
 }
开发者ID:giangpc9x,项目名称:quanlygtproject,代码行数:35,代码来源:clsDeThi_DAL.cs

示例9: getNhomNguoiDung

    public DataTable getNhomNguoiDung(clsNhomNguoiDung_DTO nhomndDTO)
    {
        ListDictionary _list = new ListDictionary();
        _list.Add("MaNhom", nhomndDTO.MaNhom);
        _list.Add("TenNhom", nhomndDTO.TenNhom);

        DataTable dt = new DataTable();
        try
        {
            dt = obj.GetDataTable("Select_Nhom_Nguoi_Dung", CommandType.StoredProcedure);
        }
        catch
        {
            dt = null;
        }
        return dt;
    }
开发者ID:giangpc9x,项目名称:quanlygtproject,代码行数:17,代码来源:clsNhomNguoiDung_DAL.cs

示例10: Fill

 private static ListDictionary Fill(ListDictionary ld, KeyValuePair<string, string>[] data)
 {
     foreach (KeyValuePair<string, string> d in data)
     {
         ld.Add(d.Key, d.Value);
     }
     return ld;
 }
开发者ID:SGuyGe,项目名称:corefx,代码行数:8,代码来源:ListDictionaryTests.cs

示例11: getLoaiCauHoi

    public DataTable getLoaiCauHoi(clsLoaiCauHoi_DTO loaiCHDTO)
    {
        ListDictionary _list = new ListDictionary();
        _list.Add("MaloaiCauHoi", loaiCHDTO.MaloaiCauHoi);
        _list.Add("TenLoaiCH", loaiCHDTO.TenLoaiCH);

        DataTable dt = new DataTable();
        try
        {
            dt = obj.GetDataTable("Select_Loai_Cau_Hoi", _list, CommandType.StoredProcedure);
        }
        catch
        {
            dt = null;
        }
        return dt;
    }
开发者ID:giangpc9x,项目名称:quanlygtproject,代码行数:17,代码来源:clsLoaiCauHoi_DAL.cs

示例12: getCauLuaChon

    public DataTable getCauLuaChon(clsCauLuaChon_DTO clcDTO)
    {
        ListDictionary _list = new ListDictionary();
        _list.Add("MaCauLuaChon", clcDTO.MaCauLuaChon);
        _list.Add("NoiDungCLC", clcDTO.NoiDungCLC);

        DataTable dt = new DataTable();
        try
        {
            dt = obj.GetDataTable("Select_Cau_Lua_Chon", CommandType.StoredProcedure);
        }
        catch
        {
            dt = null;
        }
        return dt;
    }
开发者ID:giangpc9x,项目名称:quanlygtproject,代码行数:17,代码来源:clsCauLuaChon_DAL.cs

示例13: getCTQuyen

    public DataTable getCTQuyen(clsCTQuyen_DTO ctqDTO)
    {
        ListDictionary _list = new ListDictionary();
        _list.Add("MaQuyen", ctqDTO.MaQuyen);
        _list.Add("MaNhom", ctqDTO.MaNhom);

        DataTable dt = new DataTable();
        try
        {
            dt = obj.GetDataTable("Select_CT_Quyen", CommandType.StoredProcedure);
        }
        catch
        {
            dt = null;
        }
        return dt;
    }
开发者ID:giangpc9x,项目名称:quanlygtproject,代码行数:17,代码来源:clsCTQuyen_DAL.cs

示例14: NonGenericICollectionFactory

 protected override ICollection NonGenericICollectionFactory(int count)
 {
     ListDictionary list = new ListDictionary();
     int seed = 13453;
     for (int i = 0; i < count; i++)
         list.Add(CreateT(seed++), CreateT(seed++));
     return list.Keys;
 }
开发者ID:swaroop-sridhar,项目名称:corefx,代码行数:8,代码来源:ListDictionary.Values.Tests.cs

示例15: getQuyen

    public DataTable getQuyen(clsQuyen_DTO qDTO)
    {
        ListDictionary _list = new ListDictionary();
        _list.Add("MaQuyen", qDTO.MaQuyen);
        _list.Add("MoTa", qDTO.MoTa);

        DataTable dt = new DataTable();
        try
        {
            dt = obj.GetDataTable("Select_Quyen", CommandType.StoredProcedure);
        }
        catch
        {
            dt = null;
        }
        return dt;
    }
开发者ID:giangpc9x,项目名称:quanlygtproject,代码行数:17,代码来源:clsQuyen_DAL.cs


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