Пример #1
0
        protected override void FormLoad()
        {
            base.FormLoad();
            InitCustomerCmb();
            //DisPlayEnum.ExtGetEnumDS(lkpPeriodUnit, typeof(periodUnit));
            var pUds = DisPlayEnum.getEnumDS(typeof(periodUnit));

            lkpPeriodUnit.ExtBindingDataSource(pUds, "key", "value");
            //DisPlayEnum.ExtGetEnumDS(lkpRevType, typeof(receiveType));
            var rtds = DisPlayEnum.getEnumDS(typeof(receiveType));

            lkpRevType.ExtBindingDataSource(rtds, "key", "value");
            this.barbtn1.Visibility      = BarItemVisibility.Always;
            this.barbtn1.LargeImageIndex = 8;
            gcSaledetail.DataSource      = m_saleProducts;
            if (formmode == frmmodetype.add)
            {
                m_saleorder = new T_saleorder();
            }
            else if (formmode == frmmodetype.edit)
            {
                m_saleorder = m_ssclient.getSaleOrderbyId(m_soid);
                SetData(m_saleorder);
                m_saleProducts          = m_ssclient.getSaleProductbysoid(m_soid);
                gcSaledetail.DataSource = m_saleProducts;
                gvSaledetail.RefreshData();

                colpcode.OptionsColumn.AllowEdit       = false;
                colpname.OptionsColumn.AllowEdit       = false;
                colpspec.OptionsColumn.AllowEdit       = false;
                colpmodelprice.OptionsColumn.AllowEdit = false;
                colpunitprice.OptionsColumn.AllowEdit  = false;
                colptotalprice.OptionsColumn.AllowEdit = false;
            }
            else if (formmode == frmmodetype.delete)
            {
                m_saleorder = m_ssclient.getSaleOrderbyId(m_soid);
                SetData(m_saleorder);
                readonlytxtbox(this.Controls, true);
                gvSaledetail.OptionsBehavior.Editable = false;
                m_saleProducts = m_ssclient.getSaleProductbysoid(m_soid);
                gcSaledetail.RefreshDataSource();
            }
        }
Пример #2
0
        protected override void FormLoad()
        {
            base.FormLoad();
            var customerlst = m_crmclient.getCustomerList();

            lkpcustomer.ExtBindingDataSource <T_Customer>(customerlst, "id", "customername");

            var pUds = DisPlayEnum.getEnumDS(typeof(periodUnit));

            lkpPeriodUnit.ExtBindingDataSource(pUds, "key", "value");

            var rtds = DisPlayEnum.getEnumDS(typeof(receiveType));

            lkpRevType.ExtBindingDataSource(rtds, "key", "value");

            readonlytxtbox(this.Controls, true);

            m_saleorder = m_ssclient.getSaleOrderbyId(m_soid);
            SetData(m_saleorder);
            if (m_saleorder.receivetype == (int)receiveType.产品明细收款)
            {
                m_saleProducts       = m_ssclient.getSaleProductbysoid(m_soid);
                gcRecieve.DataSource = m_saleProducts;
                gcRecieve.MainView   = gvSaledetail;
                //gvSaledetail.RefreshData();
                colpcount.OptionsColumn.AllowEdit      = false;
                colpcode.OptionsColumn.AllowEdit       = false;
                colpname.OptionsColumn.AllowEdit       = false;
                colpspec.OptionsColumn.AllowEdit       = false;
                colpmodelprice.OptionsColumn.AllowEdit = false;
                colpunitprice.OptionsColumn.AllowEdit  = false;
                colptotalprice.OptionsColumn.AllowEdit = false;
                colpcount.OptionsColumn.AllowEdit      = false;
            }
            else
            {
                this.barbtn1.Visibility       = BarItemVisibility.Always;
                this.barbtn1.LargeImageIndex  = 8;
                this.barbtn1.Caption          = "收款登记";
                this.ribbonPageGroup2.Visible = true;
                m_saleRev                      = m_ssclient.getSaleRevbySoid(m_soid);
                gcRecieve.DataSource           = m_saleRev;
                gcRecieve.MainView             = gvSaleRev;
                colsrid.Visible                = false;
                colsoid.Visible                = false;
                coluid.OptionsColumn.AllowEdit = false;
            }
        }