Files
xxcpzs/XXCpzs/ViewModels/DabaoViewModel.cs
2020-04-03 11:55:02 +08:00

55 lines
1.6 KiB
C#

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
using XXCpzs.helper;
using XXCpzs.Models;
namespace XXCpzs.ViewModels
{
class DabaoViewModel : BaseViewModel
{
private int Uid;
public ObservableCollection<DabaoTypes> dabaoTypes { get; set; }
public ObservableCollection<DabaoBrands> dabaoBrands { get; set; }
public ObservableCollection<ResultModel> Items { get; set; }
public DabaoViewModel(int uid)
{
this.Uid = uid;
Title = "产品入库";
dabaoTypes = new ObservableCollection<DabaoTypes>();
dabaoBrands = new ObservableCollection<DabaoBrands>();
Items = new ObservableCollection<ResultModel>();
Items.Add(new ResultModel { Code = 0, Data = "序列号", Msg = "提交结果" });
Dictionary<string, string> _body = new Dictionary<string, string>{
{ "Uid", Uid.ToString() }
};
List<DabaoTypes> dt = HttpHelper.RefreshData<DabaoTypes>(07, RestSharp.Method.POST, _body);
if (dt != null)
{
foreach (var item in dt)
{
dabaoTypes.Add(item);
}
}
List<DabaoBrands> buMens = HttpHelper.RefreshData<DabaoBrands>(08, RestSharp.Method.POST, _body);
if (buMens != null)
{
foreach (var item in buMens)
{
dabaoBrands.Add(item);
}
}
}
}
}