Exemple #1
0
        public IActionResult Index()
        {
            var order = OrdersDetails.GetAllRecords();

            ViewBag.datasource = order.ToArray();
            return(View());
        }
        public IActionResult Index()
        {
            var Order = OrdersDetails.GetAllRecords();

            ViewBag.DataSource = Order;
            return(View());
        }
Exemple #3
0
        public IActionResult Grid()
        {
            var DataSource = OrdersDetails.GetAllRecords().ToList();

            ViewData["datasource"] = DataSource;
            return(PartialView("Grid", ViewData));
        }
Exemple #4
0
        public object PostTest([FromBody] OrdersDetails value)
        {
            OrdersDetails.GetAllRecords().Add(value);
            var Data  = OrdersDetails.GetAllRecords().ToList();
            int count = Data.Count();

            return(Json(new { result = Data, count = count }));
        }
Exemple #5
0
        public object Get(string id)
        {
            var queryString = Request.Query;
            var dataa       = Convert.ToString(queryString["id"]);
            var data        = OrdersDetails.GetAllRecords().Where(user => user.CustomerID == dataa).ToList();

            return(new { Items = data, Count = data.Count() });
        }
        public IActionResult UrlDatasource([FromBody] Data dm)
        {
            var order = OrdersDetails.GetAllRecords();
            var Data  = order.ToList();
            int count = order.Count();

            return(dm.requiresCounts ? Json(new { result = Data.Skip(dm.skip).Take(dm.take), count = count }) : Json(Data));
        }
Exemple #7
0
        public object GetTest()
        {
            var queryString = Request.Query;
            int skip        = Convert.ToInt32(queryString["$skip"]);
            int take        = Convert.ToInt32(queryString["$top"]);
            var data        = OrdersDetails.GetAllRecords().ToList();

            return(Json(new { Items = data.Skip(skip).Take(take), Count = data.Count() }));
        }
        public IActionResult GridDatasource([FromBody] DataManagerRequest dm)
        {
            var DataSource = OrdersDetails.GetAllRecords().ToList();

            DataOperations operation = new DataOperations();
            int            count     = DataSource.Count();

            return(dm.RequiresCounts ? Json(new { result = DataSource.Skip(dm.Skip).Take(dm.Take), count = count }) : Json(DataSource));
        }
Exemple #9
0
        //insert the record
        public ActionResult InsertArray([FromBody] List <OrdersDetails> value)
        {
            for (int i = 0; i < value.Count; i++)
            {
                OrdersDetails.GetAllRecords().Insert(0, value[i]);
            }
            var data = OrdersDetails.GetAllRecords().ToList();

            return(Json(data));
        }
        public ActionResult Update([FromBody] CRUDModel <OrdersDetails> value)
        {
            var           ord = value.Value;
            OrdersDetails val = OrdersDetails.GetAllRecords().Where(or => or.OrderID == ord.OrderID).FirstOrDefault();

            val.OrderID     = ord.OrderID;
            val.ShipName    = ord.ShipName;
            val.CustomerID  = ord.CustomerID;
            val.ShipCountry = ord.ShipCountry;

            return(Json(value.Value));
        }
Exemple #11
0
        public object Put([FromBody] OrdersDetails value)
        {
            var           ord = value;
            OrdersDetails val = OrdersDetails.GetAllRecords().Where(or => or.OrderID == ord.OrderID).FirstOrDefault();

            val.OrderID    = ord.OrderID;
            val.EmployeeID = ord.EmployeeID;
            val.CustomerID = ord.CustomerID;
            val.Freight    = ord.Freight;
            val.OrderDate  = ord.OrderDate;
            val.ShipCity   = ord.ShipCity;
            return(value);
        }
Exemple #12
0
        public ActionResult Update([FromBody] CRUDModel <OrdersDetails> value)
        {
            var           ord = value.value;
            OrdersDetails val = OrdersDetails.GetAllRecords().Where(or => or.OrderID == ord.OrderID).FirstOrDefault();

            val.OrderID    = ord.OrderID;
            val.EmployeeID = ord.EmployeeID;
            val.CustomerID = ord.CustomerID;
            val.Freight    = ord.Freight;
            val.OrderDate  = ord.OrderDate;
            val.ShipCity   = ord.ShipCity;

            return(Json(value.value));
        }
        public IActionResult Index()
        {
            var Order = OrdersDetails.GetAllRecords();

            ViewBag.DataSource = Order;
            var shipcity = ShipCityDetails.getShipCityData();

            ViewBag.ShipCityData = shipcity;
            var shipCountry = ShipCountryDetails.getShipCountryData();

            ViewBag.ShipCountryData = shipCountry;

            return(View());
        }
Exemple #14
0
        public IActionResult Index()
        {
            DataTable dt = new DataTable("Student");

            dt.Columns.Add("value", typeof(Int32));
            dt.Columns.Add("text", typeof(string));

            dt.Rows.Add(1, "MANISH");
            dt.Rows.Add(2, "PASTA");
            List <detail> studentList = new List <detail>();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                detail customer = new detail();
                customer.value = Convert.ToInt32(dt.Rows[i]["value"].ToString());
                customer.text  = dt.Rows[i]["text"].ToString();
                studentList.Add(customer);
            }
            ViewBag.dataSource   = OrdersDetails.GetAllRecords().ToList();
            ViewBag.DropDownData = studentList.ToList();
            return(View());
        }
 //insert the record
 public ActionResult Insert([FromBody] CRUDModel <OrdersDetails> value)
 {
     OrdersDetails.GetAllRecords().Insert(0, value.value);
     return(Json(value.value));
 }
 public IActionResult Index()
 {
     ViewBag.datasource = OrdersDetails.GetAllRecords().ToList();
     return(View());
 }
 //Delete the record
 public ActionResult Delete([FromBody] CRUDModel <OrdersDetails> value)
 {
     OrdersDetails.GetAllRecords().Remove(OrdersDetails.GetAllRecords().Where(or => or.OrderID == int.Parse(value.key.ToString())).FirstOrDefault());
     return(Json(value));
 }
Exemple #18
0
 public IActionResult Index()
 {
     ViewBag.DataSource  = OrdersDetails.GetAllRecords().ToList();
     ViewBag.culturetype = new string[] { "fr", "ar", "de" };
     return(View());
 }
Exemple #19
0
 public object Delete(int id)
 {
     OrdersDetails.GetAllRecords().Remove(OrdersDetails.GetAllRecords().Where(or => or.OrderID == id).FirstOrDefault());
     return(Json(id));
 }