Ejemplo n.º 1
0
        public async Task <IActionResult> GetMasters(Syncfusion.JavaScript.DataManager dataManagerObj, string value)
        {
            dynamic DataSource = new System.Dynamic.ExpandoObject();

            Syncfusion.JavaScript.DataSources.DataOperations operation = new Syncfusion.JavaScript.DataSources.DataOperations();

            switch (value)
            {
            case "Country":
                DataSource = await _masterService.GetAllCountries();

                return(Json(operation.Execute(DataSource, dataManagerObj)));

            case "Modules":
                DataSource = await _masterService.GetAllMasterDetailsbyIds(new List <int>() { 12, 10 });

                return(Json(operation.Execute(DataSource, dataManagerObj)));

            case "SecurityQuestion":
                DataSource = await _masterService.GetAllMasterDetailsbyIds(new List <int>() { ModuleConstantHelper.SecurityModule });

                return(Json(operation.Execute(DataSource, dataManagerObj)));

            default:
                return(null);
            }
        }
Ejemplo n.º 2
0
    public void ExportExcel_Click()
    {
        state_load();
        //foreach (char gr in   FlatGrid.Model.ColumnSelected.ToList())
        //  {
        //      TextBox1.Text = gr.ToString();
        //  }
        BindDataSource1();//this is importent kanna
        //GridAssetList = this.FlatGrid.DataSource as List<Assets>;//this is importent kanna
        Syncfusion.JavaScript.DataSources.DataOperations ds = new Syncfusion.JavaScript.DataSources.DataOperations();
        var data1 = ds.Execute(AssetList, this.FlatGrid.Model); // passed the grid dataSource and grid dataSource in DataOperations execute method

        //var data1 = ds.Execute(GridAssetList, this.FlatGrid.Model); // passed the grid dataSource and grid dataSource in DataOperations execute method
        Response.Clear();
        Response.Buffer = true;
        Response.AddHeader("content-disposition", "attachment;filename=AssetRegister.xls");
        Response.Charset     = "";
        Response.ContentType = "application/vnd.ms-excel";
        using (StringWriter sw = new StringWriter())
        {
            HtmlTextWriter hw = new HtmlTextWriter(sw);
            GridView1.AllowPaging = false;
            GridView1.DataSource  = data1;
            GridView1.DataBind();
            GridView1.RenderControl(hw);

            string style = @"<style>.textmode { } </style>";
            Response.Write(style);
            Response.Output.Write(sw.ToString());
            Response.Flush();
            Response.End();
        }
    }
        // GET: Employee
        public ActionResult Index(DataManager value)
        {
            var models = GetTestData();

            IEnumerable Data = GetTestData();

            Syncfusion.JavaScript.DataSources.DataOperations operation = new Syncfusion.JavaScript.DataSources.DataOperations();

            var data = operation.Execute(models, value);

            if (value.Where != null && value.Where.Count > 0) //Filtering
            {
                data = operation.PerformWhereFilter(models, value.Where, value.Where[0].Operator);
            }
            return(Json(data, JsonRequestBehavior.AllowGet));
        }