Example #1
0
        private DataTable dtOLevel;                           //選擇權級距

        public W40073(string programID, string programName) : base(programID, programName)
        {
            InitializeComponent();
            this.Text = _ProgramID + "─" + _ProgramName;
            dao40071  = new D40071();
            dao40072  = new D40072();
            daoMGD2   = new MGD2();
            daoMGD2L  = new MGD2L();
            daoMGRT1  = new MGRT1();
            daoMOCF   = new MOCF();
            dtFLevel  = new DataTable();
            dtFLevel  = daoMGRT1.dddw_mgrt1("F"); //先讀,後面在不同的地方會用到
            dtOLevel  = new DataTable();
            dtOLevel  = daoMGRT1.dddw_mgrt1("O"); //先讀,後面在不同的地方會用到
            GridHelper.SetCommonGrid(gvMain);
            GridHelper.SetCommonGrid(gvDetail);
            gvDetail.AppearancePrint.BandPanel.Font = new Font("Microsoft YaHei", 10);
            gvDetail.AppearancePrint.BandPanel.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;
        }
Example #2
0
            public override ReturnMessageClass Export()
            {
                ReturnMessageClass msg = new ReturnMessageClass();

                msg.Status = ResultStatus.Fail;

                try {
                    FilePath = PbFunc.wf_copy_file(ProgramId, $"{ProgramId}_{AdjType}");

                    base.OpenFileAndSetYear();

                    //說明文
                    string prepoStr = Dt.AsEnumerable().Any(d => d.Field <string>("prod_type") == "F") ? "期貨契約保證金及" : "";

                    foreach (DataRow dr in Dt.Rows)
                    {
                        string abbrName_Desc = dr["KIND_ABBR_NAME"].AsString();

                        GenKindNameList(dr, prepoStr, "", abbrName_Desc);
                    }

                    string implBeginDate = Dt.Rows[0]["impl_begin_ymd"].AsString();
                    string implEndDate   = Dt.Rows[0]["impl_end_ymd"].AsString();
                    string mocfDate      = new MOCF().GetMaxOcfDate(implBeginDate, implEndDate);

                    implBeginDate = implBeginDate.AsDateTime("yyyyMMdd").AsTaiwanDateTime("{0}年{1}月{2}日", 3);
                    implEndDate   = implEndDate.AsDateTime("yyyyMMdd").AsTaiwanDateTime("{0}年{1}月{2}日", 3);
                    mocfDate      = mocfDate.AsDateTime("yyyyMMdd").AsTaiwanDateTime("{0}年{1}月{2}日", 3);

                    ReplaceElementWord(implBeginDate, implEndDate, GenArrayTxt(KindNameList_Desc), mocfDate, implEndDate);

                    Doc.Save(FilePath);
                    msg.Status = ResultStatus.Success;
                    return(msg);
                } catch (Exception ex) {
                    base.ErrorHandle(ex, msg);
                    return(msg);
                }
            }
Example #3
0
        private bool SaveFlag;        //用於delete row後, 是曾經執行save function.
        #endregion

        public W40074(string programID, string programName) : base(programID, programName)
        {
            InitializeComponent();
            this.Text        = _ProgramID + "─" + _ProgramName;
            dao40071         = new D40071();
            dao40072         = new D40072();
            dao40074         = new D40074();
            daoMGD2          = new MGD2();
            daoMGD2L         = new MGD2L();
            daoMGRT1         = new MGRT1();
            daoMOCF          = new MOCF();
            daoOCFG          = new OCFG();
            dtFLevel         = daoMGRT1.dddw_mgrt1("F");         //先讀,後面在不同的地方會用到
            dtOLevel         = daoMGRT1.dddw_mgrt1("O");         //先讀,後面在不同的地方會用到
            dtProdType       = dao40071.d_40071_prod_type_ddl(); //先讀,後面在不同的地方會用到
            dtDel            = new DataTable();
            kindIDLookUpEdit = new RepositoryItemLookUpEdit();
            GridHelper.SetCommonGrid(gvMain);
            gvMain.AppearancePrint.BandPanel.Font = new Font("Microsoft YaHei", 10);
            gvMain.AppearancePrint.BandPanel.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;
            SaveFlag = true;
        }