using B3DealerClient.BO;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.ObjectModel;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace B3DealerClient.Windows.CarcassSaleOutWindow_
|
|
{
|
|
public class CarcassSaleOutContext : NotificationObject
|
|
{
|
|
private DateTime? mDate = DateTime.Today;
|
|
|
|
public DateTime? Date
|
|
{
|
|
get { return mDate; }
|
|
set
|
|
{
|
|
mDate = value;
|
|
RaisePropertyChanged("Date");
|
|
}
|
|
}
|
|
|
|
private NameIDPair mDriverGoodsLine = new NameIDPair() { Name = "请选择" };
|
|
public NameIDPair DriverGoodsLine { get { return mDriverGoodsLine; } }
|
|
|
|
private NameIDPair mStore = new NameIDPair();
|
|
public NameIDPair Store { get { return mStore; } }
|
|
|
|
private decimal? mHookWeight;
|
|
public decimal? HookWeight
|
|
{
|
|
get { return mHookWeight; }
|
|
set
|
|
{
|
|
mHookWeight = value;
|
|
RaisePropertyChanged("HookWeight");
|
|
}
|
|
}
|
|
|
|
private string mStrNumber;
|
|
public string StrNumber
|
|
{
|
|
get { return mStrNumber; }
|
|
set
|
|
{
|
|
mStrNumber = value;
|
|
RaisePropertyChanged("StrNumber");
|
|
RaisePropertyChanged("CanSave");
|
|
}
|
|
}
|
|
|
|
public decimal Number
|
|
{
|
|
get
|
|
{
|
|
decimal d;
|
|
decimal.TryParse(mStrNumber, out d);
|
|
if (d == 0)
|
|
throw new Exception("头数输入不正确");
|
|
return d;
|
|
}
|
|
}
|
|
|
|
decimal number
|
|
{
|
|
get
|
|
{
|
|
decimal d;
|
|
decimal.TryParse(mStrNumber, out d);
|
|
return d;
|
|
}
|
|
}
|
|
|
|
private decimal mWeight;
|
|
public decimal Weight
|
|
{
|
|
get { return mWeight; }
|
|
set
|
|
{
|
|
mWeight = value;
|
|
RaisePropertyChanged("CanSave");
|
|
}
|
|
}
|
|
|
|
public bool Finish
|
|
{
|
|
get
|
|
{
|
|
return mDmo == null ? true : mDmo.AssignFinished;
|
|
}
|
|
set
|
|
{
|
|
RaisePropertyChanged("CanSave");
|
|
RaisePropertyChanged("CanDelete");
|
|
}
|
|
}
|
|
|
|
private CarcassSaleOut mDmo = null;
|
|
public CarcassSaleOut Dmo
|
|
{
|
|
get { return mDmo; }
|
|
set
|
|
{
|
|
mDmo = value;
|
|
RaisePropertyChanged("Dmo");
|
|
RaisePropertyChanged("CanSave");
|
|
}
|
|
}
|
|
|
|
private List<CarcassSaleOut> mDmoList = null;
|
|
public List<CarcassSaleOut> DmoList { get { return mDmoList; } set { mDmoList = value; RaisePropertyChanged("DmoList"); } }
|
|
|
|
private readonly ObservableCollection<CarcassSaleOut_Record> mDetails = new ObservableCollection<CarcassSaleOut_Record>();
|
|
public ObservableCollection<CarcassSaleOut_Record> Details { get { return mDetails; } }
|
|
|
|
private CarcassSaleOut_Record mDetail = null;
|
|
public CarcassSaleOut_Record Detail
|
|
{
|
|
get { return mDetail; }
|
|
set
|
|
{
|
|
mDetail = value;
|
|
//RaisePropertyChanged("Detail");
|
|
RaisePropertyChanged("CanDelete");
|
|
}
|
|
}
|
|
|
|
private List<CustomerObj> mCustomerList = null;
|
|
public List<CustomerObj> CustomerList { get { return mCustomerList; } set { mCustomerList = value; RaisePropertyChanged("CustomerList"); } }
|
|
|
|
public bool CanSave { get { return number > 0 && Weight > 0 && mDmo != null && !Finish; } }
|
|
|
|
public bool CanDelete { get { return mDetail != null && mDmo != null && !Finish; } }
|
|
}
|
|
}
|