public IActionResult OnPostShipperDelete(int ShipperID)
        {
            Api.ApiShipper.X api = new Api.ApiShipper.X();
            api.Delete(ShipperID);

            return(this.Direct());
        }
        public IEnumerable <object> Get_Shippers()
        {
            var retval = new List <object>();

            Api.ApiShipper.X w3 = new Api.ApiShipper.X();
            foreach (var item in w3.List())
            {
                retval.Add(new object[] { item.ShipperName, item.Phone, item.ShipperID, item.EnDis });
            }
            return(retval);
        }
 public IActionResult OnPostShipperEnable(bool EnDis, int id)
 {
     Api.ApiShipper.X shp = new Api.ApiShipper.X();
     shp.EnableDisable(EnDis, id);
     return(this.Direct());
 }
        public IActionResult OnPostSave(string Mode, string Data, string DataType, bool IsCustomer, string record_index)
        {
            switch (DataType)
            {
            case "WIN_CNT_CAT":
                if (Mode == "N")
                {
                    Api.ApiCategory.X cat = new Api.ApiCategory.X();
                    var objcat            = JsonConvert.DeserializeObject <Categories_Model>(Data);
                    cat.Create(objcat.CategoryName, objcat.Description);
                }
                else if (Mode == "E")
                {
                    Api.ApiCategory.X cat = new Api.ApiCategory.X();
                    var objcat            = JsonConvert.DeserializeObject <Categories_Model>(Data);
                    cat.Update(objcat.CategoryName, objcat.Description, objcat.CategoryID);
                }
                break;

            case "WIN_CNT_SHP":
                if (Mode == "N")
                {
                    Api.ApiShipper.X shp = new Api.ApiShipper.X();
                    var objshp           = JsonConvert.DeserializeObject <Shippers_Model>(Data);
                    shp.Create(objshp.ShipperName, objshp.Phone);
                }
                else if (Mode == "E")
                {
                    Api.ApiShipper.X shp = new Api.ApiShipper.X();
                    var objshp           = JsonConvert.DeserializeObject <Shippers_Model>(Data);
                    shp.Update(objshp.ShipperName, objshp.Phone, objshp.ShipperID);
                }
                break;

            case "WIN_FRM_PARTNERS":
                var objpartners      = JsonConvert.DeserializeObject <Partners_Model>(Data);
                Api.ApiCustomer.X cs = new Api.ApiCustomer.X();
                Api.ApiSupplier.X sp = new Api.ApiSupplier.X();
                if (IsCustomer)
                {
                    if (Mode == "N")
                    {
                        cs.Create(objpartners.Name, objpartners.ContactName, objpartners.Address,
                                  objpartners.City, objpartners.PostalCode, objpartners.Country);
                    }
                    else if (Mode == "E")
                    {
                        cs.Update(objpartners.ContactName, objpartners.Address,
                                  objpartners.City, objpartners.PostalCode, objpartners.Country, objpartners.ID);
                    }
                }
                else
                {
                    if (Mode == "N")
                    {
                        sp.Create(objpartners.Name, objpartners.ContactName, objpartners.Address,
                                  objpartners.City, objpartners.PostalCode, objpartners.Country);
                    }
                    else if (Mode == "E")
                    {
                        sp.Update(objpartners.ContactName, objpartners.Address,
                                  objpartners.City, objpartners.PostalCode, objpartners.Country, objpartners.ID);
                    }
                }
                break;

            default:
                break;
            }
            return(this.Direct());
        }