Example #1
0
 private void getMessage()
 {
     foreach (var a in App.todayLogMessage)
     {
         string type = "";
         float  price;
         string Catepory = "";
         if (a.flag == true)
         {
             type     = "进货";
             price    = a.price;
             Catepory = "-";
         }
         else
         {
             type     = "售货";
             price    = a.price * a.discount;
             Catepory = "+";
         }
         Catepory += Convert.ToString(price * a.num);
         DateTime        dt = a.time;
         todayLogMessage s  = new todayLogMessage(type, a.commodityName, a.id, a.num.ToString(), price.ToString(), Catepory, dt);
         Today.Add(s);
         //todayListView.Items.Add(s);
     }
 }
Example #2
0
        private void Display()
        {
            dayLogList.Clear();
            dayListView.DataContext = dayLogList;
            PageTitle.Text          = year + "年" + mouth + "月" + day + "日";
            List <LogMessage> dayList = new List <LogMessage>();
            DateTime          dt      = dayPicker.Date.Date;

            dayList = manager.getLogMessageByDay(dt);
            if (dayList != null)
            {
                foreach (var a in dayList)
                {
                    string type = "";
                    float  price;
                    string Catepory = "";
                    if (a.flag == true)
                    {
                        type     = "进货";
                        price    = a.price;
                        Catepory = "-";
                    }
                    else
                    {
                        type     = "售货";
                        price    = a.price * a.discount;
                        Catepory = "+";
                    }
                    Catepory += Convert.ToString(price * a.num);
                    DateTime        logTime = a.time;
                    todayLogMessage s       = new todayLogMessage(type, a.commodityName, a.id, a.num.ToString(), price.ToString(), Catepory, logTime);
                    dayLogList.Add(s);
                }
            }

            dayListView.DataContext = dayLogList;

            Money thisDay = new Money();

            thisDay        = manager.getAmountOfMoney(dt, flagCode.day);
            incomeAll.Text = "收入:" + thisDay.inMoney.ToString();
            sellAll.Text   = "支出" + thisDay.outMoney.ToString();
            allDB.Text     = "总收益" + (thisDay.outMoney - thisDay.inMoney).ToString();
        }
Example #3
0
        /// <summary>
        ///
        /// </summary>
        private void Display()
        {
            yearDisplayList.Clear();
            mouthListView.DataContext = yearDisplayList;
            PageTitle.Text            = year + "年";
            List <LogMessage> yearList = new List <LogMessage>();


            DateTime dt = new DateTime(year, 1, 1);

            yearList = manager.getLogMessageByYear(dt);
            foreach (var a in yearList)
            {
                string type = "";
                float  price;
                string Catepory = "";
                if (a.flag == true)
                {
                    type     = "进货";
                    price    = a.price;
                    Catepory = "-";
                }
                else
                {
                    type     = "售货";
                    price    = a.price * a.discount;
                    Catepory = "+";
                }
                Catepory += Convert.ToString(price * a.num);
                DateTime        logTime = a.time;
                todayLogMessage s       = new todayLogMessage(type, a.commodityName, a.id, a.num.ToString(), price.ToString(), Catepory, logTime);
                yearDisplayList.Add(s);
            }
            mouthListView.DataContext = yearDisplayList;
            Money yearMoney = new Money();

            yearMoney      = manager.getAmountOfMoney(dt, flagCode.year);
            incomeAll.Text = "总支出:" + yearMoney.inMoney.ToString();
            sellAll.Text   = "总收入:" + yearMoney.outMoney.ToString();
            allDB.Text     = "总收益:" + (yearMoney.outMoney - yearMoney.inMoney).ToString();
        }