| @ -0,0 +1,92 @@ | |||
| using B3DealerClient.BO; | |||
| using Forks.EnterpriseServices.DomainObjects2.DQuery; | |||
| using Forks.JsonRpc.Client; | |||
| using Newtonsoft.Json; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| using B3DealerClient.Utils; | |||
| using Forks.EnterpriseServices.DomainObjects2; | |||
| namespace B3DealerClient.BL | |||
| { | |||
| public static class CarcassSaleOutBL | |||
| { | |||
| const string MethodPath = @"/MainSystem/B3Dealer/Rpcs/SaleOutStoreRpc/"; | |||
| public static List<CarcassSaleOut> GetDmoList(object condition) | |||
| { | |||
| var method = MethodPath + "GetSaleOutStoreList"; | |||
| var json = RpcFacade.Call<string>(method, JsonConvert.SerializeObject(condition)); | |||
| var list = JsonConvert.DeserializeObject<List<CarcassSaleOut>>(json); | |||
| FillAlreadyInfo(list); | |||
| return list; | |||
| } | |||
| private static void FillAlreadyInfo(List<CarcassSaleOut> list) | |||
| { | |||
| if (list.Count == 0) | |||
| return; | |||
| var query = new DQueryDom(new JoinAlias(typeof(CarcassSaleOut_Record))); | |||
| query.Where.Conditions.Add(DQCondition.InList(DQExpression.Field("DetailID"), list.Select(x => DQExpression.Value(x.ID)).ToArray())); | |||
| query.Columns.Add(DQSelectColumn.Field("DetailID")); | |||
| query.Columns.Add(DQSelectColumn.Sum("NetWeight")); | |||
| query.Columns.Add(DQSelectColumn.Sum("SecondNumber")); | |||
| query.GroupBy.Expressions.Add(DQExpression.Field("DetailID")); | |||
| var records = query.EExecuteList<long, decimal, decimal>(); | |||
| foreach (var item in records) | |||
| { | |||
| var f = list.First(x => x.DetailID == item.Item1); | |||
| f.AlreadyNumber = item.Item2; | |||
| f.AlreadySecondNumber = item.Item3; | |||
| } | |||
| } | |||
| public static List<CustomerObj> GetCustomers(object condition) | |||
| { | |||
| var method = MethodPath + "GetCustomers"; | |||
| var json = RpcFacade.Call<string>(method, JsonConvert.SerializeObject(condition)); | |||
| return JsonConvert.DeserializeObject<List<CustomerObj>>(json); | |||
| } | |||
| public static IEnumerable<CarcassSaleOut_Record> GetDetailRecords(long detailID) | |||
| { | |||
| var query = new DmoQuery(typeof(CarcassSaleOut_Record)); | |||
| query.Where.Conditions.Add(DQCondition.EQ("DetailID", detailID)); | |||
| query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID")); | |||
| return query.EExecuteList().Cast<CarcassSaleOut_Record>(); | |||
| } | |||
| public static void Delete(long id) | |||
| { | |||
| var del = new DQDeleteDom(typeof(CarcassSaleOut_Record)); | |||
| del.Where.Conditions.Add(DQCondition.EQ("ID", id)); | |||
| del.EExecute(); | |||
| } | |||
| public static void InsertRecord(CarcassSaleOut_Record record) | |||
| { | |||
| using (var session = DmoSession.New()) | |||
| { | |||
| session.Insert(record); | |||
| session.Commit(); | |||
| } | |||
| } | |||
| public static void FinishAssign(long id) | |||
| { | |||
| var target = GetBillRecords(id); | |||
| RpcFacade.Call<int>(MethodPath + "FinishAssign", JsonConvert.SerializeObject(target), id); | |||
| } | |||
| public static IEnumerable<CarcassSaleOut_Record> GetBillRecords(long billID) | |||
| { | |||
| var query = new DmoQuery(typeof(CarcassSaleOut_Record)); | |||
| query.Where.Conditions.Add(DQCondition.EQ("MainID", billID)); | |||
| query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID")); | |||
| return query.EExecuteList().Cast<CarcassSaleOut_Record>(); | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,92 @@ | |||
| using B3DealerClient.BO; | |||
| using Forks.EnterpriseServices.DomainObjects2; | |||
| using Forks.EnterpriseServices.DomainObjects2.DQuery; | |||
| using Forks.JsonRpc.Client; | |||
| using Newtonsoft.Json; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| using B3DealerClient.Utils; | |||
| using System.Collections; | |||
| namespace B3DealerClient.BL | |||
| { | |||
| public static class FreshInStoreBL | |||
| { | |||
| const string MethodPath = @"/MainSystem/B3Dealer/Rpcs/PayBillRpc/"; | |||
| public static List<FreshInStore> GetDmoList(object condition) | |||
| { | |||
| var method = MethodPath + "GetPayBillList"; | |||
| var json = RpcFacade.Call<string>(method, JsonConvert.SerializeObject(condition)); | |||
| return JsonConvert.DeserializeObject<List<FreshInStore>>(json); | |||
| } | |||
| public static List<FreshInStore_Detail> GetDmoDetailList(long id) | |||
| { | |||
| var method = MethodPath + "GetPayBillDetails"; | |||
| var json = RpcFacade.Call<string>(method, id); | |||
| var list = JsonConvert.DeserializeObject<List<FreshInStore_Detail>>(json); | |||
| FillAlreadyInfo(list); | |||
| return list; | |||
| } | |||
| static void FillAlreadyInfo(List<FreshInStore_Detail> details) | |||
| { | |||
| if (details.Count == 0) | |||
| return; | |||
| var query = new DQueryDom(new JoinAlias(typeof(FreshInStore_Record))); | |||
| query.Columns.Add(DQSelectColumn.Field("DetailID")); | |||
| query.Columns.Add(DQSelectColumn.Sum("Weight")); | |||
| query.Columns.Add(DQSelectColumn.Sum("Number")); | |||
| query.GroupBy.Expressions.Add(DQExpression.Field("DetailID")); | |||
| query.Where.Conditions.Add(DQCondition.InList(DQExpression.Field("DetailID"), details.Select(x => DQExpression.Value(x.ID)).ToArray())); | |||
| var list = query.EExecuteList<long, decimal?, decimal?>(); | |||
| foreach (var item in list) | |||
| { | |||
| var first = details.First(x => x.ID == item.Item1); | |||
| first.AlreadyNumber = item.Item2; | |||
| first.AlreadySecondNumber = item.Item3; | |||
| } | |||
| } | |||
| public static long FinishInStore(long id) | |||
| { | |||
| var target = GetReceiveInfo(id); | |||
| return RpcFacade.Call<long>(MethodPath + "FreshFinishInStore", JsonConvert.SerializeObject(target)); | |||
| } | |||
| private static IList GetReceiveInfo(long id) | |||
| { | |||
| var query = new DmoQuery(typeof(FreshInStore_Record)); | |||
| query.Where.Conditions.Add(DQCondition.EQ("BillID",id)); | |||
| return query.EExecuteList(); | |||
| } | |||
| public static void InsertRecord(FreshInStore_Record record) | |||
| { | |||
| using (var session = DmoSession.New()) | |||
| { | |||
| var id = GetExistID(session, record); | |||
| if (id.HasValue) | |||
| { | |||
| record.ID = id.Value; | |||
| session.Update(record); | |||
| } | |||
| else | |||
| session.Insert(record); | |||
| session.Commit(); | |||
| } | |||
| } | |||
| static long? GetExistID(IDmoSession session, FreshInStore_Record record) | |||
| { | |||
| var query = new DQueryDom(new JoinAlias(typeof(FreshInStore_Record))); | |||
| query.Columns.Add(DQSelectColumn.Field("ID")); | |||
| query.Where.Conditions.Add(DQCondition.EQ("DetailID", record.DetailID)); | |||
| return query.EExecuteScalar<long?>(session); | |||
| } | |||
| } | |||
| } | |||
| @ -1,88 +0,0 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| namespace B3DealerClient.BO | |||
| { | |||
| public class CarcassInStore : NotificationObject | |||
| { | |||
| private long mID; | |||
| public long ID | |||
| { | |||
| get { return mID; } | |||
| set | |||
| { | |||
| mID = value; | |||
| RaisePropertyChanged("ID"); | |||
| } | |||
| } | |||
| private string mSupplier_Name; | |||
| public string Supplier_Name | |||
| { | |||
| get { return mSupplier_Name; } | |||
| set | |||
| { | |||
| mSupplier_Name = value; | |||
| RaisePropertyChanged("Supplier_Name"); | |||
| } | |||
| } | |||
| private DateTime? mDate; | |||
| public DateTime? Date | |||
| { | |||
| get { return mDate; } | |||
| set | |||
| { | |||
| mDate = value; | |||
| RaisePropertyChanged("Date"); | |||
| } | |||
| } | |||
| private DateTime? mArrivedDate; | |||
| public DateTime? ArrivedDate | |||
| { | |||
| get { return mArrivedDate; } | |||
| set | |||
| { | |||
| mArrivedDate = value; | |||
| RaisePropertyChanged("ArrivedDate"); | |||
| } | |||
| } | |||
| private string mStore_Name; | |||
| public string Store_Name | |||
| { | |||
| get { return mStore_Name; } | |||
| set | |||
| { | |||
| mStore_Name = value; | |||
| RaisePropertyChanged("Store_Name"); | |||
| } | |||
| } | |||
| private bool mSelected; | |||
| public bool Selected | |||
| { | |||
| get { return mSelected; } | |||
| set | |||
| { | |||
| mSelected = value; | |||
| RaisePropertyChanged("Selected"); | |||
| } | |||
| } | |||
| private List<CarcassInStore_Detail> mDetails = new List<CarcassInStore_Detail>(); | |||
| public List<CarcassInStore_Detail> Details | |||
| { | |||
| get { return mDetails; } | |||
| set | |||
| { | |||
| mDetails = value; | |||
| RaisePropertyChanged("Details"); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,43 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| namespace B3DealerClient.BO | |||
| { | |||
| public class CarcassInStore : NotificationObject | |||
| { | |||
| public long ID { get; set; } | |||
| public string Supplier_Name { get; set; } | |||
| public DateTime? Date { get; set; } | |||
| public DateTime? ArrivedDate { get; set; } | |||
| public string Store_Name { get; set; } | |||
| private bool mSelected; | |||
| public bool Selected | |||
| { | |||
| get { return mSelected; } | |||
| set | |||
| { | |||
| mSelected = value; | |||
| RaisePropertyChanged("Selected"); | |||
| } | |||
| } | |||
| private List<CarcassInStore_Detail> mDetails = new List<CarcassInStore_Detail>(); | |||
| public List<CarcassInStore_Detail> Details | |||
| { | |||
| get { return mDetails; } | |||
| set | |||
| { | |||
| mDetails = value; | |||
| RaisePropertyChanged("Details"); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,58 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Collections.ObjectModel; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| namespace B3DealerClient.BO | |||
| { | |||
| public class CarcassInStore_Detail : NotificationObject | |||
| { | |||
| public long ID { get; set; } | |||
| public long PayBill_ID { get; set; } | |||
| public string Goods_Name { get; set; } | |||
| public decimal? Number { get; set; } | |||
| public decimal? SecondNumber { get; set; } | |||
| private decimal? mAlreadyNumber; | |||
| public decimal? AlreadyNumber | |||
| { | |||
| get { return mAlreadyNumber; } | |||
| set | |||
| { | |||
| mAlreadyNumber = value; | |||
| RaisePropertyChanged("AlreadyNumber"); | |||
| } | |||
| } | |||
| private decimal? mAlreadySecondNumber; | |||
| public decimal? AlreadySecondNumber | |||
| { | |||
| get { return mAlreadySecondNumber; } | |||
| set | |||
| { | |||
| mAlreadySecondNumber = value; | |||
| RaisePropertyChanged("AlreadySecondNumber"); | |||
| } | |||
| } | |||
| private bool mSelected; | |||
| public bool Selected | |||
| { | |||
| get { return mSelected; } | |||
| set | |||
| { | |||
| mSelected = value; | |||
| RaisePropertyChanged("Selected"); | |||
| } | |||
| } | |||
| private readonly ObservableCollection<CarcassInStore_Receive> mDetails = new ObservableCollection<CarcassInStore_Receive>(); | |||
| public ObservableCollection<CarcassInStore_Receive> Details { get { return mDetails; } } | |||
| } | |||
| } | |||
| @ -0,0 +1,52 @@ | |||
| using Forks.EnterpriseServices.DomainObjects2; | |||
| using Newtonsoft.Json; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| namespace B3DealerClient.BO | |||
| { | |||
| [MapToTable("B3DealerClient_CarcassInStore_Receive")] | |||
| [KeyField("ID", KeyGenType.identity)] | |||
| public class CarcassInStore_Receive : NotificationObject | |||
| { | |||
| [JsonIgnore] | |||
| public long ID{get;set;} | |||
| public long DetailID{get;set;} | |||
| public long MainID{get;set;} | |||
| public string Goods_Name{get;set;} | |||
| public decimal Weight{get;set;} | |||
| public decimal Discont{get;set;} | |||
| public decimal NetWeight{get;set;} | |||
| public decimal Pics{get;set;} | |||
| private DateTime mDate = DateTime.Now; | |||
| public DateTime Date | |||
| { | |||
| get { return mDate; } | |||
| set { mDate = value; } | |||
| } | |||
| private bool mSelected; | |||
| [NonDmoProperty] | |||
| [JsonIgnore] | |||
| public bool Selected | |||
| { | |||
| get { return mSelected; } | |||
| set | |||
| { | |||
| mSelected = value; | |||
| RaisePropertyChanged("Selected"); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @ -1,103 +0,0 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Collections.ObjectModel; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| namespace B3DealerClient.BO | |||
| { | |||
| public class CarcassInStore_Detail : NotificationObject | |||
| { | |||
| private long mID; | |||
| public long ID | |||
| { | |||
| get { return mID; } | |||
| set | |||
| { | |||
| mID = value; | |||
| RaisePropertyChanged("ID"); | |||
| } | |||
| } | |||
| private long mPayBill_ID; | |||
| public long PayBill_ID | |||
| { | |||
| get { return mPayBill_ID; } | |||
| set | |||
| { | |||
| mPayBill_ID = value; | |||
| RaisePropertyChanged("PayBill_ID"); | |||
| } | |||
| } | |||
| private string mGoods_Name; | |||
| public string Goods_Name | |||
| { | |||
| get { return mGoods_Name; } | |||
| set | |||
| { | |||
| mGoods_Name = value; | |||
| RaisePropertyChanged("Goods_Name"); | |||
| } | |||
| } | |||
| private decimal? mNumber; | |||
| public decimal? Number | |||
| { | |||
| get { return mNumber; } | |||
| set | |||
| { | |||
| mNumber = value; | |||
| RaisePropertyChanged("Number"); | |||
| } | |||
| } | |||
| private decimal? mSecondNumber; | |||
| public decimal? SecondNumber | |||
| { | |||
| get { return mSecondNumber; } | |||
| set | |||
| { | |||
| mSecondNumber = value; | |||
| RaisePropertyChanged("SecondNumber"); | |||
| } | |||
| } | |||
| private decimal? mAlreadyNumber; | |||
| public decimal? AlreadyNumber | |||
| { | |||
| get { return mAlreadyNumber; } | |||
| set | |||
| { | |||
| mAlreadyNumber = value; | |||
| RaisePropertyChanged("AlreadyNumber"); | |||
| } | |||
| } | |||
| private decimal? mAlreadySecondNumber; | |||
| public decimal? AlreadySecondNumber | |||
| { | |||
| get { return mAlreadySecondNumber; } | |||
| set | |||
| { | |||
| mAlreadySecondNumber = value; | |||
| RaisePropertyChanged("AlreadySecondNumber"); | |||
| } | |||
| } | |||
| private bool mSelected; | |||
| public bool Selected | |||
| { | |||
| get { return mSelected; } | |||
| set | |||
| { | |||
| mSelected = value; | |||
| RaisePropertyChanged("Selected"); | |||
| } | |||
| } | |||
| private readonly ObservableCollection<CarcassInStore_Receive> mDetails=new ObservableCollection<CarcassInStore_Receive>(); | |||
| public ObservableCollection<CarcassInStore_Receive> Details { get { return mDetails; } } | |||
| } | |||
| } | |||
| @ -1,127 +0,0 @@ | |||
| using Forks.EnterpriseServices.DomainObjects2; | |||
| using Newtonsoft.Json; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| namespace B3DealerClient.BO | |||
| { | |||
| [MapToTable("B3DealerClient_CarcassInStore_Receive")] | |||
| [KeyField("ID", KeyGenType.identity)] | |||
| public class CarcassInStore_Receive : NotificationObject | |||
| { | |||
| private long mID; | |||
| [JsonIgnore] | |||
| public long ID | |||
| { | |||
| get { return mID; } | |||
| set | |||
| { | |||
| mID = value; | |||
| RaisePropertyChanged("ID"); | |||
| } | |||
| } | |||
| private long mDetailID; | |||
| public long DetailID | |||
| { | |||
| get { return mDetailID; } | |||
| set | |||
| { | |||
| mDetailID = value; | |||
| RaisePropertyChanged("DetailID"); | |||
| } | |||
| } | |||
| private long mMainID; | |||
| public long MainID | |||
| { | |||
| get { return mMainID; } | |||
| set | |||
| { | |||
| mMainID = value; | |||
| RaisePropertyChanged("MainID"); | |||
| } | |||
| } | |||
| private string mGoods_Name; | |||
| public string Goods_Name | |||
| { | |||
| get { return mGoods_Name; } | |||
| set | |||
| { | |||
| mGoods_Name = value; | |||
| RaisePropertyChanged("Goods_Name"); | |||
| } | |||
| } | |||
| private decimal mWeight; | |||
| public decimal Weight | |||
| { | |||
| get { return mWeight; } | |||
| set | |||
| { | |||
| mWeight = value; | |||
| RaisePropertyChanged("Weight"); | |||
| } | |||
| } | |||
| private decimal mDiscont; | |||
| public decimal Discont | |||
| { | |||
| get { return mDiscont; } | |||
| set | |||
| { | |||
| mDiscont = value; | |||
| RaisePropertyChanged("Discont"); | |||
| } | |||
| } | |||
| private decimal mNetWeight; | |||
| public decimal NetWeight | |||
| { | |||
| get { return mNetWeight; } | |||
| set | |||
| { | |||
| mNetWeight = value; | |||
| RaisePropertyChanged("NetWeight"); | |||
| } | |||
| } | |||
| private decimal mPics; | |||
| public decimal Pics | |||
| { | |||
| get { return mPics; } | |||
| set | |||
| { | |||
| mPics = value; | |||
| RaisePropertyChanged("Pics"); | |||
| } | |||
| } | |||
| private DateTime mDate = DateTime.Now; | |||
| public DateTime Date | |||
| { | |||
| get { return mDate; } | |||
| set | |||
| { | |||
| mDate = value; | |||
| RaisePropertyChanged("Date"); | |||
| } | |||
| } | |||
| private bool mSelected; | |||
| [NonDmoProperty] | |||
| public bool Selected | |||
| { | |||
| get { return mSelected; } | |||
| set | |||
| { | |||
| mSelected = value; | |||
| RaisePropertyChanged("Selected"); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,73 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| namespace B3DealerClient.BO | |||
| { | |||
| public class CarcassSaleOut : NotificationObject | |||
| { | |||
| public long ID { get; set; } | |||
| public string Customer_Name { get; set; } | |||
| public string Driver_Name { get; set; } | |||
| public string Store_Name { get; set; } | |||
| public DateTime? LoadTime { get; set; } | |||
| public long DetailID { get; set; } | |||
| public string Goods_Name { get; set; } | |||
| public decimal? Number { get; set; } | |||
| public decimal? SecondNumber { get; set; } | |||
| private decimal? mAlreadyNumber; | |||
| public decimal? AlreadyNumber | |||
| { | |||
| get { return mAlreadyNumber; } | |||
| set | |||
| { | |||
| mAlreadyNumber = value; | |||
| RaisePropertyChanged("AlreadyNumber"); | |||
| } | |||
| } | |||
| private decimal? mAlreadySecondNumber; | |||
| public decimal? AlreadySecondNumber | |||
| { | |||
| get { return mAlreadySecondNumber; } | |||
| set | |||
| { | |||
| mAlreadySecondNumber = value; | |||
| RaisePropertyChanged("AlreadySecondNumber"); | |||
| } | |||
| } | |||
| private bool mAssignFinished; | |||
| public bool AssignFinished | |||
| { | |||
| get { return mAssignFinished; } | |||
| set | |||
| { | |||
| mAssignFinished = value; | |||
| RaisePropertyChanged("AssignFinished"); | |||
| } | |||
| } | |||
| private bool mSelected; | |||
| public bool Selected | |||
| { | |||
| get { return mSelected; } | |||
| set | |||
| { | |||
| mSelected = value; | |||
| RaisePropertyChanged("Selected"); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,52 @@ | |||
| using Forks.EnterpriseServices.DomainObjects2; | |||
| using Newtonsoft.Json; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| namespace B3DealerClient.BO | |||
| { | |||
| [MapToTable("B3DealerClient_CarcassSaleOut_Record")] | |||
| [KeyField("ID", KeyGenType.identity)] | |||
| public class CarcassSaleOut_Record : NotificationObject | |||
| { | |||
| [JsonIgnore] | |||
| public long ID { get; set; } | |||
| public long DetailID { get; set; } | |||
| public long MainID { get; set; } | |||
| public string Goods_Name { get; set; } | |||
| public decimal Weight { get; set; } | |||
| public decimal Discont { get; set; } | |||
| public decimal NetWeight { get; set; } | |||
| public decimal SecondNumber { get; set; } | |||
| private DateTime mDate = DateTime.Now; | |||
| public DateTime Date | |||
| { | |||
| get { return mDate; } | |||
| set { mDate = value; } | |||
| } | |||
| private bool mSelected; | |||
| [NonDmoProperty] | |||
| [JsonIgnore] | |||
| public bool Selected | |||
| { | |||
| get { return mSelected; } | |||
| set | |||
| { | |||
| mSelected = value; | |||
| RaisePropertyChanged("Selected"); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,33 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| namespace B3DealerClient.BO | |||
| { | |||
| public class CustomerObj : NotificationObject | |||
| { | |||
| public long ID { get; set; } | |||
| public string Name { get; set; } | |||
| public bool Finished { get; set; } | |||
| private bool mSelected; | |||
| public bool Selected | |||
| { | |||
| get { return mSelected; } | |||
| set | |||
| { | |||
| mSelected = value; | |||
| RaisePropertyChanged("Selected"); | |||
| } | |||
| } | |||
| public bool Equals(CustomerObj obj) | |||
| { | |||
| return this.ID == obj.ID && this.Finished == obj.Finished; | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,43 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| namespace B3DealerClient.BO | |||
| { | |||
| public class FreshInStore : NotificationObject | |||
| { | |||
| public long ID { get; set; } | |||
| public string Supplier_Name { get; set; } | |||
| public DateTime? Date { get; set; } | |||
| public DateTime? ArrivedDate { get; set; } | |||
| public string Store_Name { get; set; } | |||
| private bool mSelected; | |||
| public bool Selected | |||
| { | |||
| get { return mSelected; } | |||
| set | |||
| { | |||
| mSelected = value; | |||
| RaisePropertyChanged("Selected"); | |||
| } | |||
| } | |||
| private List<FreshInStore_Detail> mDetails = new List<FreshInStore_Detail>(); | |||
| public List<FreshInStore_Detail> Details | |||
| { | |||
| get { return mDetails; } | |||
| set | |||
| { | |||
| mDetails = value; | |||
| RaisePropertyChanged("Details"); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,54 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| namespace B3DealerClient.BO | |||
| { | |||
| public class FreshInStore_Detail : NotificationObject | |||
| { | |||
| public long ID { get; set; } | |||
| public long PayBill_ID { get; set; } | |||
| public string Goods_Name { get; set; } | |||
| public decimal? Number { get; set; } | |||
| public decimal? SecondNumber { get; set; } | |||
| private decimal? mAlreadyNumber; | |||
| public decimal? AlreadyNumber | |||
| { | |||
| get { return mAlreadyNumber; } | |||
| set | |||
| { | |||
| mAlreadyNumber = value; | |||
| RaisePropertyChanged("AlreadyNumber"); | |||
| } | |||
| } | |||
| private decimal? mAlreadySecondNumber; | |||
| public decimal? AlreadySecondNumber | |||
| { | |||
| get { return mAlreadySecondNumber; } | |||
| set | |||
| { | |||
| mAlreadySecondNumber = value; | |||
| RaisePropertyChanged("AlreadySecondNumber"); | |||
| } | |||
| } | |||
| private bool mSelected; | |||
| public bool Selected | |||
| { | |||
| get { return mSelected; } | |||
| set | |||
| { | |||
| mSelected = value; | |||
| RaisePropertyChanged("Selected"); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,24 @@ | |||
| using Forks.EnterpriseServices.DomainObjects2; | |||
| using Newtonsoft.Json; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| namespace B3DealerClient.BO | |||
| { | |||
| [MapToTable("B3DealerClient_FreshInStore_Record")] | |||
| [KeyField("ID", KeyGenType.identity)] | |||
| public class FreshInStore_Record | |||
| { | |||
| [JsonIgnore] | |||
| public long ID { get; set; } | |||
| public long BillID { get; set; } | |||
| public long DetailID { get; set; } | |||
| public decimal? Weight { get; set; } | |||
| public decimal? Number { get; set; } | |||
| } | |||
| } | |||
| @ -0,0 +1,16 @@ | |||
| using B3DealerClient.BO; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| namespace B3DealerClient.Windows.CarcassSaleOutWindow_ | |||
| { | |||
| public class CarcassSaleOutConfig | |||
| { | |||
| public NameIDPair Store { get; set; } | |||
| public decimal? HookWeight { get; set; } | |||
| } | |||
| } | |||
| @ -0,0 +1,137 @@ | |||
| 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; } } | |||
| } | |||
| } | |||
| @ -0,0 +1,17 @@ | |||
| <Window x:Class="B3DealerClient.Windows.CarcassSaleOutWindow_.RecordViewDialog" | |||
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||
| Title="称重记录" Height="500" Width="800" FontSize="17"> | |||
| <Border Margin="5" Style="{StaticResource DefaultBorder}"> | |||
| <DataGrid x:Name="grid" Margin="5"> | |||
| <DataGrid.Columns> | |||
| <DataGridTextColumn Binding="{Binding Goods_Name}" Header="存货" Width="1.0*"/> | |||
| <DataGridTextColumn Binding="{Binding Weight, StringFormat=\{0:0.######\}}" Header="重量" Width="0.6*"/> | |||
| <DataGridTextColumn Binding="{Binding Discont, StringFormat=\{0:0.######\}}" Header="扣重" Width="0.6*"/> | |||
| <DataGridTextColumn Binding="{Binding NetWeight, StringFormat=\{0:0.######\}}" Header="净重" Width="0.6*"/> | |||
| <DataGridTextColumn Binding="{Binding SecondNumber, StringFormat=\{0:0.######\}}" Header="件数" Width="0.6*"/> | |||
| <DataGridTextColumn Binding="{Binding Date ,StringFormat=\{0:HH:mm:ss\}}" Header="确认时间" Width="0.8*"/> | |||
| </DataGrid.Columns> | |||
| </DataGrid> | |||
| </Border> | |||
| </Window> | |||
| @ -0,0 +1,36 @@ | |||
| using B3DealerClient.BL; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| using System.Windows; | |||
| using System.Windows.Controls; | |||
| using System.Windows.Data; | |||
| using System.Windows.Documents; | |||
| using System.Windows.Input; | |||
| using System.Windows.Media; | |||
| using System.Windows.Media.Imaging; | |||
| using System.Windows.Shapes; | |||
| namespace B3DealerClient.Windows.CarcassSaleOutWindow_ | |||
| { | |||
| /// <summary> | |||
| /// RecordViewDialog.xaml 的交互逻辑 | |||
| /// </summary> | |||
| public partial class RecordViewDialog : Window | |||
| { | |||
| long BillID; | |||
| public RecordViewDialog(long id) | |||
| { | |||
| InitializeComponent(); | |||
| BillID = id; | |||
| this.Loaded += RecordViewDialog_Loaded; | |||
| } | |||
| void RecordViewDialog_Loaded(object sender, RoutedEventArgs e) | |||
| { | |||
| grid.ItemsSource = CarcassSaleOutBL.GetBillRecords(BillID); | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,27 @@ | |||
| using B3DealerClient.BO; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Globalization; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| using System.Windows.Data; | |||
| namespace B3DealerClient.Windows.CarcassSaleOutWindow_ | |||
| { | |||
| public class TrueToFalseConverter : IValueConverter | |||
| { | |||
| public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | |||
| { | |||
| if (value == null) | |||
| return false; | |||
| var v = (CarcassSaleOut)value; | |||
| return !v.AssignFinished; | |||
| } | |||
| public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | |||
| { | |||
| throw new NotImplementedException(); | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,16 @@ | |||
| using B3DealerClient.BO; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| namespace B3DealerClient.Windows.FreshInStoreWindow_ | |||
| { | |||
| public class FreshInStoreConfig | |||
| { | |||
| public NameIDPair Store { get; set; } | |||
| public decimal? Pics { get; set; } | |||
| } | |||
| } | |||
| @ -0,0 +1,74 @@ | |||
| using B3DealerClient.BO; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| namespace B3DealerClient.Windows.FreshInStoreWindow_ | |||
| { | |||
| class FreshInStoreContext : NotificationObject | |||
| { | |||
| private DateTime? mDate = DateTime.Today; | |||
| public DateTime? Date | |||
| { | |||
| get { return mDate; } | |||
| set | |||
| { | |||
| mDate = value; | |||
| RaisePropertyChanged("Date"); | |||
| } | |||
| } | |||
| private DateTime? mArrivedDate; | |||
| public DateTime? ArrivedDate | |||
| { | |||
| get { return mArrivedDate; } | |||
| set | |||
| { | |||
| mArrivedDate = value; | |||
| RaisePropertyChanged("ArrivedDate"); | |||
| } | |||
| } | |||
| private NameIDPair mSupplier = new NameIDPair(); | |||
| public NameIDPair Supplier { get { return mSupplier; } } | |||
| private NameIDPair mStore = new NameIDPair(); | |||
| public NameIDPair Store { get { return mStore; } } | |||
| private decimal? mPics; | |||
| public decimal? Pics | |||
| { | |||
| get { return mPics; } | |||
| set | |||
| { | |||
| mPics = value; | |||
| RaisePropertyChanged("Pics"); | |||
| RaisePropertyChanged("CanSave"); | |||
| } | |||
| } | |||
| private FreshInStore mDmo = null; | |||
| public FreshInStore Dmo { get { return mDmo; } set { mDmo = value; RaisePropertyChanged("Dmo"); } } | |||
| private FreshInStore_Detail mDetail = null; | |||
| public FreshInStore_Detail Detail { get { return mDetail; } set { mDetail = value; RaisePropertyChanged("Detail"); RaisePropertyChanged("CanSave"); } } | |||
| private List<FreshInStore> dmoList = new List<FreshInStore>(); | |||
| public List<FreshInStore> DmoList | |||
| { | |||
| get { return dmoList; } | |||
| set | |||
| { | |||
| dmoList = value; | |||
| this.RaisePropertyChanged("DmoList"); | |||
| } | |||
| } | |||
| public bool CanSave { get { return Pics > 0 && mDetail != null; } } | |||
| } | |||
| } | |||
| @ -0,0 +1,43 @@ | |||
| <Window x:Class="B3DealerClient.Windows.Test" | |||
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||
| Title="Test" Height="300" Width="300"> | |||
| <Grid> | |||
| <ListBox x:Name="lb"> | |||
| <ListBox.Resources> | |||
| <Style TargetType="Button" BasedOn="{StaticResource RedButton}"> | |||
| <EventSetter Event="PreviewMouseDown" Handler="BtnClick"/> | |||
| </Style> | |||
| </ListBox.Resources> | |||
| <ListBox.ItemTemplate> | |||
| <DataTemplate> | |||
| <Button MinWidth="80" > | |||
| <Button.Content> | |||
| <TextBlock Text="{Binding Name}"/> | |||
| </Button.Content> | |||
| </Button> | |||
| </DataTemplate> | |||
| </ListBox.ItemTemplate> | |||
| </ListBox> | |||
| <!--<ListView x:Name="lv"> | |||
| <ListView.Resources> | |||
| <Style TargetType="Button" BasedOn="{StaticResource RedButton}"> | |||
| <EventSetter Event="PreviewMouseDown" Handler="BtnClick"/> | |||
| </Style> | |||
| </ListView.Resources> | |||
| <ListView.ItemTemplate> | |||
| <DataTemplate> | |||
| <Button MinWidth="80" > | |||
| <Button.Content> | |||
| <TextBlock Text="{Binding Name}"/> | |||
| </Button.Content> | |||
| </Button> | |||
| </DataTemplate> | |||
| </ListView.ItemTemplate> | |||
| </ListView>--> | |||
| </Grid> | |||
| </Window> | |||
| @ -0,0 +1,44 @@ | |||
| using B3DealerClient.BO; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| using System.Windows; | |||
| using System.Windows.Controls; | |||
| using System.Windows.Data; | |||
| using System.Windows.Documents; | |||
| using System.Windows.Input; | |||
| using System.Windows.Media; | |||
| using System.Windows.Media.Imaging; | |||
| using System.Windows.Shapes; | |||
| namespace B3DealerClient.Windows | |||
| { | |||
| /// <summary> | |||
| /// Test.xaml 的交互逻辑 | |||
| /// </summary> | |||
| public partial class Test : Window | |||
| { | |||
| List<NameIDPair> Items; | |||
| public Test() | |||
| { | |||
| InitializeComponent(); | |||
| Items = new List<NameIDPair>(); | |||
| Items.Add(new NameIDPair() { ID = 1, Name = "张三" }); | |||
| Items.Add(new NameIDPair() { ID = 2, Name = "张1" }); | |||
| Items.Add(new NameIDPair() { ID = 3, Name = "张2" }); | |||
| Items.Add(new NameIDPair() { ID = 4, Name = "张4" }); | |||
| Items.Add(new NameIDPair() { ID = 5, Name = "张5" }); | |||
| Items.Add(new NameIDPair() { ID = 6, Name = "张6" }); | |||
| lb .ItemsSource = Items; | |||
| } | |||
| private void BtnClick(object sender, MouseButtonEventArgs e) | |||
| { | |||
| var btn = sender as Button; | |||
| var tag = btn.Tag as NameIDPair; | |||
| MessageBox.Show(tag.ID.ToString()); | |||
| } | |||
| } | |||
| } | |||