Ejemplo n.º 1
0
        public W40040(string programID, string programName) : base(programID, programName)
        {
            InitializeComponent();
            this.Text = _ProgramID + "─" + _ProgramName;
            //預設交易時段
            OCFG daoOCFG = new OCFG();

            oswGrpLookItem.SetDataTable(daoOCFG.ListAll(), "OSW_GRP", "OSW_GRP_NAME", DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor, null);
            oswGrpLookItem.EditValue = daoOCFG.f_gen_osw_grp();
        }
Ejemplo n.º 2
0
        protected override ResultStatus Open()
        {
            base.Open();
            //取得table的schema,因為程式開啟會預設插入一筆空資料列
            DataTable dtMGD2 = dao40074.d_40074();

            gcMain.DataSource = dtMGD2;

            #region  拉選單設定
            //調整狀態下拉選單
            //List<LookupItem> statusList = new List<LookupItem>(){
            //                            new LookupItem() { ValueMember = "Y", DisplayMember = "上市"},
            //                            new LookupItem() { ValueMember = "D", DisplayMember = "下市"}};

            DataTable dtStatusList = new CODW().ListLookUpEdit("40074", "ADJ_CODE");
            statusLookUpEdit = new RepositoryItemLookUpEdit();
            statusLookUpEdit.SetColumnLookUp(dtStatusList, "CODW_ID", "CODW_DESC", TextEditStyles.DisableTextEditor, null);
            gcMain.RepositoryItems.Add(statusLookUpEdit);
            ADJ_CODE.ColumnEdit = statusLookUpEdit;
            //保證金型態下拉選單
            //List<LookupItem> typeList = new List<LookupItem>(){
            //                               new LookupItem() { ValueMember = "F", DisplayMember = "金額"},
            //                               new LookupItem() { ValueMember = "P", DisplayMember = "百分比"}};

            DataTable dtTypeList = new CODW().ListLookUpEdit("40074", "AMT_TYPE");
            typeLookUpEdit = new RepositoryItemLookUpEdit();
            typeLookUpEdit.SetColumnLookUp(dtTypeList, "CODW_ID", "CODW_DESC", TextEditStyles.DisableTextEditor, null);
            gcMain.RepositoryItems.Add(typeLookUpEdit);
            AMT_TYPE.ColumnEdit = typeLookUpEdit;

            //商品類下拉選單
            prodTypeLookUpEdit = new RepositoryItemLookUpEdit();
            prodTypeLookUpEdit.SetColumnLookUp(dtProdType, "PROD_SEQ_NO", "SUBTYPE_NAME", TextEditStyles.DisableTextEditor, null);
            gcMain.RepositoryItems.Add(prodTypeLookUpEdit);
            PROD_SEQ_NO.ColumnEdit = prodTypeLookUpEdit;

            //幣別下拉選單
            //DataTable dtCurrency = daoCOD.ListByCurrency();
            DataTable dtCurrency = new CODW().ListLookUpEdit("APDK", "APDK_CURRENCY_TYPE");
            currencyTypeLookUpEdit = new RepositoryItemLookUpEdit();
            currencyTypeLookUpEdit.SetColumnLookUp(dtCurrency, "CODW_ID", "CODW_DESC", TextEditStyles.DisableTextEditor, null);
            gcMain.RepositoryItems.Add(currencyTypeLookUpEdit);
            CURRENCY_TYPE.ColumnEdit = currencyTypeLookUpEdit;

            //級距下拉選單
            //期貨
            fLevelLookUpEdit = new RepositoryItemLookUpEdit();
            fLevelLookUpEdit.SetColumnLookUp(dtFLevel, "MGRT1_LEVEL", "MGRT1_LEVEL_NAME", TextEditStyles.DisableTextEditor, null);
            gcMain.RepositoryItems.Add(fLevelLookUpEdit);
            M_LEVEL.ColumnEdit = fLevelLookUpEdit; //開啟時預設為期貨
                                                   //選擇權
            oLevelLookUpEdit = new RepositoryItemLookUpEdit();
            oLevelLookUpEdit.SetColumnLookUp(dtOLevel, "MGRT1_LEVEL", "MGRT1_LEVEL_NAME", TextEditStyles.DisableTextEditor, null);
            gcMain.RepositoryItems.Add(oLevelLookUpEdit);

            //盤別下拉選單
            DataTable dtOswGrp = daoOCFG.ListAll();
            oswGrpLookUpEdit = new RepositoryItemLookUpEdit();
            oswGrpLookUpEdit.SetColumnLookUp(dtOswGrp, "OSW_GRP", "OSW_GRP_NAME", TextEditStyles.DisableTextEditor, null);
            gcMain.RepositoryItems.Add(oswGrpLookUpEdit);
            OSW_GRP.ColumnEdit = oswGrpLookUpEdit;
            #endregion

            //預設新增一筆設定資料
            InsertRow();

            //設定日期和全域變數
            txtSDate.DateTimeValue = DateTime.Now;
#if DEBUG
            txtSDate.EditValue = "2019/03/20";
#endif
            ymd       = txtSDate.DateTimeValue.ToString("yyyyMMdd");
            isAdjType = "4";
            maxAocf   = dao40074.GetMaxAOCF(ymd.SubStr(0, 4));

            return(ResultStatus.Success);
        }