Esempio n. 1
0
        /// <summary>
        /// All The Methods That are used in coding
        /// </summary>

        #region Methods
        //public void statebind()
        //{

        //    TextInfo textInfo = new CultureInfo("en-US", false).TextInfo;

        //    var title = "WAR AND PEACE";

        //    title = textInfo.ToTitleCase(title);
        //    //Console.WriteLine(title); //WAR AND PEACE

        //    ////You need to call ToLower to make it work
        //    //title = textInfo.ToTitleCase(title.ToLower());
        //    //Console.WriteLine(title);


        //    List<tbl_state> gd = context.tbl_state.Where(x => x.status == true).ToList();
        //    DataTable dt = new DataTable();
        //    dt = helper.LINQToDataTable(gd);
        //    IEnumerable<DataRow> rows = dt.Rows.Cast<DataRow>();

        //    foreach (DataRow row in dt.Rows)
        //    {
        //        var lowerValue = row["state_name"].ToString();
        //        lowerValue = textInfo.ToTitleCase(lowerValue.ToLower());
        //        row["state_name"] = lowerValue;
        //        //row.SetField(row["state_name"].ToString(), row["state_name"][lowerValue]);
        //    }

        //    ddlState.DataSource = dt;
        //    ddlState.DataTextField = "state_name";
        //    ddlState.DataValueField = "state_id";
        //    //gd.ConvertAll(r => textInfo.ToTitleCase(r.state_name.ToLower())).ToList();
        //    //ddlState.DataSource = textInfo.ToTitleCase(title.ToLower());
        //    //ddlState.DataSource = dt;
        //    ddlState.DataBind();
        //    ddlState.Items.Insert(0, new ListItem("--Select State--", "0"));
        //}
        public void loadDataTable()
        {
            try
            {
                GridView1.DataSource = context.sp_SelectParty(companyId, branchId);
                GridView1.DataBind();
            }
            catch (Exception ex)
            {
                ErrorLog.saveerror(ex);
            }
            finally
            {
                //con.Close();
                //con.Dispose();
            }
        }