예제 #1
0
        public PUR020_PurchaseOrderEntry(PurchaseOrderHDTO hdtoPurchaseOrder)
        {
            InitializeComponent();

            #region Set Component
            shtView.ActiveSkin = Common.ACTIVE_SKIN;

            this.WindowState = FormWindowState.Maximized;

            CtrlUtil.MappingDataFieldWithEnum(shtView, typeof(eColumn));
            m_BIZPurchaseOrder = new PurchaseOrderBIZ();
            LookupDataBIZ BIZLookupData = new LookupDataBIZ();

            cboSupplierCode.Format += CommonLib.Common.ComboBox_Format;
            cboSupplierCode.LoadLookupData(BIZLookupData.LoadLookupLocation(new NZString[] { (NZString)"04", (NZString)"05" }));
            cboSupplierCode.SelectedIndex = -1;

            cboDelivery.Format += CommonLib.Common.ComboBox_Format;
            cboDelivery.LoadLookupData(BIZLookupData.LoadLookupLocation(new NZString[]
                                                                        { (NZString)DataDefine.Convert2ClassCode(DataDefine.eLOCATION_CLS.Customer),
                                                                          (NZString)DataDefine.Convert2ClassCode(DataDefine.eLOCATION_CLS.CustomerVendor) }));
            cboDelivery.SelectedIndex = -1;

            cboTermOfPayment.Format += CommonLib.Common.ComboBox_Format;
            cboTermOfPayment.LoadLookupData(BIZLookupData.LoadLookupClassType(DataDefine.TERM_OF_PAYMENT.ToNZString()));
            cboTermOfPayment.SelectedIndex = -1;

            cboCurrency.Format += CommonLib.Common.ComboBox_Format;
            cboCurrency.LoadLookupData(BIZLookupData.LoadLookupClassType(DataDefine.CURRENCY.ToNZString()));
            cboCurrency.SelectedIndex = -1;

            shtView.Columns[(int)eColumn.UNIT].CellType   = CtrlUtil.CreateComboBoxCellType(BIZLookupData.LoadLookupClassType(DataDefine.UM_CLS.ToNZString()), true);
            shtView.Columns[(int)eColumn.INV_UM].CellType = CtrlUtil.CreateComboBoxCellType(BIZLookupData.LoadLookupClassType(DataDefine.UM_CLS.ToNZString()), true);
            //shtView.Columns[(int)eColumn.STATUS].CellType = CtrlUtil.CreateComboBoxCellType(BIZLookupData.LoadLookupClassType(DataDefine.PO_STATUS.ToNZString()), true);


            // ซ่อน column บางตัว
            for (eColumn column = eColumn.PO_LINE; column < eColumn.STATUS; column++)
            {
                FarPoint.Win.Spread.Column hiddenColumn = shtView.Columns[(int)column];
                hiddenColumn.Visible = false;
                hiddenColumn.Label   = column.ToString();
                if (column == eColumn.PO_NO)
                {
                    column = eColumn.BACK_ORDER_QTY;
                }
            }
            shtView.Columns[(int)eColumn.ModifyState].Visible = false;
            shtView.Columns[(int)eColumn.KeptStatus].Visible  = false;
            shtView.Columns[(int)eColumn.RATE].Visible        = false;


            for (int iColumn = 0; iColumn < shtView.ColumnCount; iColumn++)
            {
                if (iColumn != (int)eColumn.BUTTON)
                {
                    shtView.Columns[iColumn].AllowAutoFilter = true;
                    shtView.Columns[iColumn].AllowAutoSort   = true;
                }
            }
            #endregion

            this.m_HDTOPurchaseOrder = hdtoPurchaseOrder;
        }