예제 #1
0
        public ActionResult FillAll(CommanFieldConditionalPara CFP)
        {
            try
            {

                DataSet dsList = _objWhitelabelAccessRights.BindDropdown_BaseAccessRights(CFP);
                WhitelabelStep2 CV = new WhitelabelStep2();
                Grid _grid = new Grid();
                List<GridHearder> GridHearder = new List<GridHearder>();
                List<GridColumn> GridColumn = new List<GridColumn>();
                List<Grid> lstGrid = new List<Grid>();
                if (dsList.Tables[0].Rows.Count > 0)
                {
                    ViewBag.GridHearder = dsList.Tables[0];
                    ViewBag.GridColumn = dsList.Tables[1];


                    if (dsList.Tables[0] != null)
                    {
                        foreach (System.Data.DataRow dr in ViewBag.GridColumn.Rows)
                        {
                            GridColumn.Add(new GridColumn
                            {
                                xname = @dr["xname"].ToString(),
                                SrNo = @dr["xcode"].ToString(),
                                xlink = @dr["xlink"].ToString()
                            });
                        }
                    }

                    if (dsList.Tables[1] != null)
                    {
                        foreach (System.Data.DataRow dr in ViewBag.GridHearder.Rows)
                        {
                            GridHearder.Add(new GridHearder
                            {
                                xname = @dr["xname"].ToString(),
                                SrNo = @dr["xcode"].ToString()

                            });


                        }
                    }

                }

                _grid.GridColumn = GridColumn.ToList();
                _grid.GridHearder = GridHearder.ToList();

                lstGrid.Add(_grid);
                return Json(new { ColumnList = _grid.GridColumn, HeaderList = _grid.GridHearder }, JsonRequestBehavior.AllowGet);


            }
            catch (Exception)
            {

                throw;
            }


        }
        public PartialViewResult _DisplayGridData(string id)
        {
            DataSet dsList = _objw2.Basegrid(id);
            WhitelabelStep2 CV = new WhitelabelStep2();
            Grid _grid = new Grid();
            List<GridHearder> GridHearder = new List<GridHearder>();
            List<GridColumn> GridColumn = new List<GridColumn>();
            List<Grid> lstGrid = new List<Grid>();
            if (dsList.Tables[0].Rows.Count > 0)
            {
                ViewBag.GridHearder = dsList.Tables[0];
                ViewBag.GridColumn = dsList.Tables[1];


                if (dsList.Tables[0] != null)
                {
                    foreach (System.Data.DataRow dr in ViewBag.GridColumn.Rows)
                    {
                        GridColumn.Add(new GridColumn
                        {
                            xname = @dr["xname"].ToString(),
                            SrNo = @dr["xcode"].ToString(),
                            xlink = @dr["xlink"].ToString()
                        });
                    }
                }

                if (dsList.Tables[1] != null)
                {
                    foreach (System.Data.DataRow dr in ViewBag.GridHearder.Rows)
                    {
                        GridHearder.Add(new GridHearder
                        {
                            xname = @dr["xname"].ToString(),
                            SrNo = @dr["xcode"].ToString()

                        });

                        //   var gf = GridColumn.Where(s => s.SrNo == dr["xcode"].ToString()).ToList();
                    }
                }

            }

            _grid.GridColumn = GridColumn.ToList();
            _grid.GridHearder = GridHearder.ToList();

            lstGrid.Add(_grid);
            return PartialView(lstGrid);
        }