コード例 #1
0
 public void BuildShippingTypeList()
 {
     using (FFAdminDBEntities db = new FFAdminDBEntities())
     {
         ShippingTypeList = db.ShippingType.ToList();
     }
 }
コード例 #2
0
        public ProfitForTranListViewModel(List <Tran> trans)
        {
            using (FFAdminDBEntities db = new FFAdminDBEntities())
            {
                if (trans != null || trans.Count() > 0)
                {
                    this.ProfitsVM = new List <ProfitViewModel>();
                    // get trans

                    this.Trans = trans;

                    // calculate all profits per currency
                    foreach (var x in Trans)
                    {
                        this.ProfitsVM.Add(new ProfitViewModel(x.TranID));
                    }

                    // create grouping
                    ProfitGrouping = new List <TranProfit>();
                    CreateProfitGrouping();

                    // calculate the profit
                    foreach (var x in ProfitGrouping)
                    {
                        x.Profit = x.TotalEarned - x.TotalPaid;
                    }
                }
            }
        }
コード例 #3
0
 public void BuildShippingTypeList()
 {
     using (FFAdminDBEntities db = new FFAdminDBEntities())
     {
         ShippingTypeList = db.ShippingType.ToList();
     }
 }
コード例 #4
0
        public ProfitForTranListViewModel(List<Tran> trans)
        {
            using (FFAdminDBEntities db = new FFAdminDBEntities())
            {

                if (trans != null || trans.Count() > 0)
                {
                    this.ProfitsVM = new List<ProfitViewModel>();
                    // get trans

                    this.Trans = trans;

                    // calculate all profits per currency
                    foreach (var x in Trans)
                    {
                        this.ProfitsVM.Add(new ProfitViewModel(x.TranID));
                    }

                    // create grouping
                    ProfitGrouping = new List<TranProfit>();
                    CreateProfitGrouping();

                    // calculate the profit
                    foreach (var x in ProfitGrouping)
                    {
                        x.Profit = x.TotalEarned - x.TotalPaid;
                    }

                }
            }
        }
コード例 #5
0
 public ProfitViewModel(int id)
 {
     using (FFAdminDBEntities db = new FFAdminDBEntities())
     {
         this.TranId = id;
         this.BLNo = db.Tran.FirstOrDefault(s => s.TranID == id).BLNo;
         this.Profits = db.TranProfit.Where(x => x.TranID == id).Include(t => t.Currency).ToList();
         this.Totals = db.TranTotals.Where(x => x.TranID == id).Include(t => t.Currency).ToList();
     }
 }
コード例 #6
0
 public ProfitViewModel(int id)
 {
     using (FFAdminDBEntities db = new FFAdminDBEntities())
     {
         this.TranId  = id;
         this.BLNo    = db.Tran.FirstOrDefault(s => s.TranID == id).BLNo;
         this.Profits = db.TranProfit.Where(x => x.TranID == id).Include(t => t.Currency).ToList();
         this.Totals  = db.TranTotals.Where(x => x.TranID == id).Include(t => t.Currency).ToList();
     }
 }
コード例 #7
0
 public TranContainersViewModel(int tranId)
 {
     BuildShippingTypeList();
     using (FFAdminDBEntities db = new FFAdminDBEntities())
     {
         //db.TranContainer.Include(a => a.ShippingType);
         TranContainers = db.TranContainer.Include(a => a.ShippingType).Where(t => t.TranID == tranId).ToList();
         TranID = tranId;
         StatusID = db.Tran.FirstOrDefault().TranDetail.StatusID.Value;
     }
 }
コード例 #8
0
 public TranContainersViewModel(int tranId)
 {
     BuildShippingTypeList();
     using (FFAdminDBEntities db = new FFAdminDBEntities())
     {
         //db.TranContainer.Include(a => a.ShippingType);
         TranContainers = db.TranContainer.Include(a => a.ShippingType).Where(t => t.TranID == tranId).ToList();
         TranID         = tranId;
         StatusID       = db.Tran.FirstOrDefault().TranDetail.StatusID.Value;
     }
 }
コード例 #9
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="id">Customer ID</param>
        public ProfitForCustomerViewModel(int id)
        {
            using (FFAdminDBEntities db = new FFAdminDBEntities())
            {
                this.Customer = db.Customer.Find(id);

                if (Customer != null)
                {
                    TranList = new ProfitForTranListViewModel(
                        db.Tran.Where(s => s.ConsigneeID == Customer.CustomerID)
                        .Select(s => s.TranID).ToList()
                        );
                }
            }
        }
コード例 #10
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="id">Customer ID</param>
        public ProfitForCustomerViewModel(int id)
        {
            using (FFAdminDBEntities db = new FFAdminDBEntities())
            {
                this.Customer = db.Customer.Find(id);

                if (Customer != null)
                {

                    TranList = new ProfitForTranListViewModel(
                        db.Tran.Where(s => s.ConsigneeID == Customer.CustomerID)
                        .Select(s=> s.TranID).ToList()
                        );
                }
            }
        }
コード例 #11
0
 public TranContainersViewModel()
 {
     BuildShippingTypeList();
     TranContainers = new List<TranContainer>();
     using (FFAdminDBEntities db = new FFAdminDBEntities())
     {
         foreach(var shiptype in db.ShippingType.ToList())
         {
             TranContainers.Add(new TranContainer() {
                 
                 ShippingType = shiptype,
                 Count = 0
             });
         }
     }
     TranID = -1;
     StatusID = -1;
 }
コード例 #12
0
 public TranContainersViewModel()
 {
     BuildShippingTypeList();
     TranContainers = new List <TranContainer>();
     using (FFAdminDBEntities db = new FFAdminDBEntities())
     {
         foreach (var shiptype in db.ShippingType.ToList())
         {
             TranContainers.Add(new TranContainer()
             {
                 ShippingType = shiptype,
                 Count        = 0
             });
         }
     }
     TranID   = -1;
     StatusID = -1;
 }