Example #1
0
        //gv_ClientDetails

        public void Fill_Grid()
        {
            try
            {
                DateTime _startDate = DateTime.Parse(txtStartDate.Text.ToString());
                DateTime _endDate   = DateTime.Parse(txtEndDate.Text.ToString());


                List <FBFoodInventoryInfo> items;

                FBFoodInventoryController controller = new FBFoodInventoryController();

                items = controller.FBReports_Food_Inventory(_startDate, _endDate, this.PortalId);

                if (rblGroupBy.SelectedValue.ToString().ToLower() == "reporttype")
                {
                    var so = from FBFoodInventoryInfo s in items orderby s.ReportType ascending select s;

                    gv_ClientDetails.DataSource = so;
                    gv_ClientDetails.DataBind();
                }
                else
                {
                    var so = from FBFoodInventoryInfo s in items orderby s.SupplierName, s.ReportType, s.ProductName select s;
                    gv_ClientDetails.DataSource = so;
                    gv_ClientDetails.DataBind();
                }
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }