Beispiel #1
0
 /// <summary> 计算总成本 </summary>
 /// <param name="r">成本单价</param>
 private void setCosting(ref BookCosting r)
 {
     int dBookCount = (int)MainInfo.BookPrint.BookCount;             // 册数
     int dBookPrint = MainValue.Value.PrintingCount;                 // 印数
     dBookPrint = (dBookPrint >= 2000) ? 2000 : dBookPrint;          // 只资助 2,000 册
     int dWordCount = MainInfo.BookPrint.WordCount;                  // 字数
     int dBookSize = (int)MainInfo.BookPrint.BookSize;               // 开本
     double fSheet = Math.Ceiling(dWordCount * 4 / 3.0 / dBookSize); // 印张
     double fPaperCount = dBookPrint * fSheet / 500.0;               // 令数
     // 印刷方式和印刷用纸
     double fPrintMethod = MainInfo.BookPrint.IsColorful ? r.Colorful : r.Colorless;
     double fPrintPaper = r.W60Costing;
     switch (MainInfo.BookPrint.PaperUsing)
     {
         case _BookPrinting.PaperFormat.w60 : fPrintPaper = r.W60Costing; break;
         case _BookPrinting.PaperFormat.w70 : fPrintPaper = r.W70Costing; break;
         case _BookPrinting.PaperFormat.w80 : fPrintPaper = r.W80Costing; break;
         default: break;
     }
     // 固定项目
     double fConstCosting = r.BindingAndLayout + r.Propagandizing + r.Management;
     // 字数项目
     double fWordsCosting = dWordCount * (r.Remuneration + r.Checking + r.Proofreading);
     // 排版项目
     double fCompsCosting = dWordCount * r.Composing * 4 / 3; 
     // 制版项目
     double fPlateCosting = (r.ArticlePlatemaking + r.CoverPlatemaking) * (fSheet + 2 * dBookCount);
     // 印刷项目
     double fPrintCosting = fPrintMethod * fSheet + fPrintPaper * fPaperCount;
     // 装订项目
     double fCoverCosting = 2 * fSheet * dBookCount * r.Binding;
     // 综合费用
     Costing = fConstCosting + fWordsCosting + fCompsCosting + fPlateCosting + fPrintCosting + fCoverCosting;
 }
Beispiel #2
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();
 }
Beispiel #3
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();
 }
Beispiel #4
0
        /// <summary> 计算总成本 </summary>
        /// <param name="r">成本单价</param>
        private void setCosting(ref BookCosting r)
        {
            int dBookCount = (int)MainInfo.BookPrint.BookCount;                  // 册数
            int dBookPrint = MainValue.Value.PrintingCount;                      // 印数

            dBookPrint = (dBookPrint >= 2000) ? 2000 : dBookPrint;               // 只资助 2,000 册
            int    dWordCount  = MainInfo.BookPrint.WordCount;                   // 字数
            int    dBookSize   = (int)MainInfo.BookPrint.BookSize;               // 开本
            double fSheet      = Math.Ceiling(dWordCount * 4 / 3.0 / dBookSize); // 印张
            double fPaperCount = dBookPrint * fSheet / 500.0;                    // 令数
            // 印刷方式和印刷用纸
            double fPrintMethod = MainInfo.BookPrint.IsColorful ? r.Colorful : r.Colorless;
            double fPrintPaper  = r.W60Costing;

            switch (MainInfo.BookPrint.PaperUsing)
            {
            case _BookPrinting.PaperFormat.w60: fPrintPaper = r.W60Costing; break;

            case _BookPrinting.PaperFormat.w70: fPrintPaper = r.W70Costing; break;

            case _BookPrinting.PaperFormat.w80: fPrintPaper = r.W80Costing; break;

            default: break;
            }
            // 固定项目
            double fConstCosting = r.BindingAndLayout + r.Propagandizing + r.Management;
            // 字数项目
            double fWordsCosting = dWordCount * (r.Remuneration + r.Checking + r.Proofreading);
            // 排版项目
            double fCompsCosting = dWordCount * r.Composing * 4 / 3;
            // 制版项目
            double fPlateCosting = (r.ArticlePlatemaking + r.CoverPlatemaking) * (fSheet + 2 * dBookCount);
            // 印刷项目
            double fPrintCosting = fPrintMethod * fSheet + fPrintPaper * fPaperCount;
            // 装订项目
            double fCoverCosting = 2 * fSheet * dBookCount * r.Binding;

            // 综合费用
            Costing = fConstCosting + fWordsCosting + fCompsCosting + fPlateCosting + fPrintCosting + fCoverCosting;
        }
Beispiel #5
0
 /// <summary> 获取最后资助金额 </summary>
 /// <param name="r">成本单价</param>
 /// <returns>最后资助金额</returns>
 public double getFinalValue(ref BookCosting r)
 {
     setCosting(ref r);
     setFinalValue();
     return(FinalValue);
 }
Beispiel #6
0
 /// <summary> 获取最后资助金额 </summary>
 /// <param name="r">成本单价</param>
 /// <returns>最后资助金额</returns>
 public double getFinalValue(ref BookCosting r)
 {
     setCosting(ref r);
     setFinalValue();
     return FinalValue;
 }
Beispiel #7
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 = "印刷成本";
 }