示例#1
0
        private void buttonOK_Click(object sender, EventArgs e)
        {
            BookCosting now = new BookCosting(_raw_data_set_: _raw_data_);

            Value = now;
            SaveConstData(AppPath);
            OnDisplay();
            this.Text = "印刷成本";
        }
示例#2
0
        private void SaveConstData(string path)
        {
            FileStream fileStream = new FileStream(path, FileMode.Create);

            byte[]      serBytes;
            BookCosting reff = Cost;

            ToBytes <BookCosting> .GetBytes(ref reff, out serBytes);

            fileStream.Write(serBytes, 0, serBytes.Length);
            fileStream.Flush();
            fileStream.Close();
            fileStream.Dispose();
        }
示例#3
0
        public Form_Constant()
        {
            InitializeComponent();
            AppPath = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "const.bin";
            FileInfo fi = new FileInfo(AppPath);

            if (fi.Exists)
            {
                LoadConstData(AppPath);
            }
            else
            {
                FileStream fs = fi.Create(); fs.Close();
                Value = new BookCosting();
                SaveConstData(AppPath);
            }
            OnDisplay();
            BuildCollection();
        }
示例#4
0
        private void BuildFinalList()
        {
            BookCosting costing = Cost;

            FinalList = new List <BookFinal>();
            foreach (var value in BookEval.Data)
            {
                BookEvaluaion rank = value;
                rank.Value.SetPrintingCount();
                int bid = rank.BookID, uid = rank.UserID;
                FindPerson(uid);
                BookDetail info;
                FindBookInfo(bid, out info);
                BookFinal item = new BookFinal(info, rank);
                FinalList.Add(item);
            }
            foreach (var item in FinalList)
            {
                item.getFinalValue(ref costing);
            }
        }
示例#5
0
        public Form_Result(UserSet users, BookDetailList books, BookEvaluaionList ranks)
        {
            InitializeComponent();
            AppPath = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "const.bin";
            FileInfo fi = new FileInfo(AppPath);

            if (fi.Exists)
            {
                LoadConstData(AppPath);
            }
            else
            {
                FileStream fs = fi.Create(); fs.Close();
                Cost = new BookCosting();
                SaveConstData(AppPath);
            }
            UserList = users;
            BookList = books;
            BookEval = ranks;
            BuildFinalList();
            OnDisplay();
        }