Exemple #1
0
        public EditFormProformaInvoice()
        {
            InitializeComponent();

            this.requireValueExceptions.Add(Model.ProformaInvoice.PRO_PO, new AA("PO 不能為空!", this.txt_PONo));
            this.requireValueExceptions.Add(Model.ProformaInvoice.PRO_InvoiceDate, new AA("Date 不能為空!", this.Date_InvoiceDate));
            this.requireValueExceptions.Add(Model.ProformaInvoice.PRO_CustomerId, new AA("TO 不能為空!", this.ncc_Customer));

            this.action = "view";

            this.ncc_Customer.Choose          = new Settings.BasicData.Customs.ChooseCustoms();
            this.bindingSourceBank.DataSource = new BL.BankManager().Select();


            this.repositoryItemSearchLookUpEdit1.DisplayMember = "Id";
            this.repositoryItemSearchLookUpEdit1.ValueMember   = "ProductId";
            this.repositoryItemSearchLookUpEdit1.View.Columns.Add(new GridColumn()
            {
                FieldName = "Id", Caption = "商品編號", Width = 150, Visible = true, VisibleIndex = 0
            });
            this.repositoryItemSearchLookUpEdit1.View.Columns.Add(new GridColumn()
            {
                FieldName = "ProductName", Caption = "商品名稱", Width = 150, Visible = true, VisibleIndex = 1
            });
            this.repositoryItemSearchLookUpEdit1.View.Columns.Add(new GridColumn()
            {
                FieldName = "CustomerProductName", Caption = "客戶貨品名稱", Width = 150, Visible = true, VisibleIndex = 2
            });
            this.repositoryItemSearchLookUpEdit1.View.Columns.Add(new GridColumn()
            {
                FieldName = "ProductVersion", Caption = "版本", Width = 50, Visible = true, VisibleIndex = 3
            });

            this.repositoryItemSearchLookUpEdit2.DisplayMember = "ProductName";
            this.repositoryItemSearchLookUpEdit2.ValueMember   = "ProductId";
            this.repositoryItemSearchLookUpEdit2.View.Columns.Add(new GridColumn()
            {
                FieldName = "Id", Caption = "商品編號", Width = 150, Visible = true, VisibleIndex = 0
            });
            this.repositoryItemSearchLookUpEdit2.View.Columns.Add(new GridColumn()
            {
                FieldName = "ProductName", Caption = "商品名稱", Width = 150, Visible = true, VisibleIndex = 1
            });
            this.repositoryItemSearchLookUpEdit2.View.Columns.Add(new GridColumn()
            {
                FieldName = "CustomerProductName", Caption = "客戶貨品名稱", Width = 150, Visible = true, VisibleIndex = 2
            });
            this.repositoryItemSearchLookUpEdit2.View.Columns.Add(new GridColumn()
            {
                FieldName = "ProductVersion", Caption = "版本", Width = 50, Visible = true, VisibleIndex = 3
            });

            this.repositoryItemSearchLookUpEdit1.DataSource = productManager.SelectProductForXO();
            this.repositoryItemSearchLookUpEdit2.DataSource = productManager.SelectProductForXO();
        }
        public CustomerProductPrice()
        {
            InitializeComponent();

            string errorMessage = "價格區間填寫有誤,請查證后重新保存.\r請檢查以下項目\r1.價格區間是否連續.\r2.價格不能為零.\r3.<數量上限>不得小於<數量下限>.\r4.第一段價格區間,<數量下限>必須為1";

            this.invalidValueExceptions.Add("PriceRange.Error", new AA(errorMessage, this.gridControl3));
            //this.requireValueExceptions.Add(Model.CustomerProductPrice.PRO_ProductId, new AA("商品不能為空!", this.btn_CheckProduct));

            this.bindingSourceCustomer.DataSource = (new BL.CustomerManager()).Select();
            if (this.bindingSourceCustomer.DataSource != null && this.bindingSourceCustomer.Count > 0)
            {
                this._CustomerProductPriceList = this._manage.SelectByCustomerId((this.bindingSourceCustomer.Current as Model.Customer).CustomerId);
                this.customer = this.bindingSourceCustomer[0] as Model.Customer;
            }
            if (this._CustomerProductPriceList != null && this._CustomerProductPriceList.Count > 0)
            {
                this._CustomerProductPrice = this._CustomerProductPriceList[0];
            }
            this.bindingSourceCustomerProduct.DataSource = this._CustomerProductPriceList;
            this.bindingSourcePriceRang.DataSource       = this._priceRangeList;
            this.nccBuildEmployee.Choose  = new Employees.ChooseEmployee();
            this.nccChangeEmployee.Choose = new Employees.ChooseEmployee();
            this.action = "view";

            this.slue_ProductId.Properties.DisplayMember = "Id";
            this.slue_ProductId.Properties.ValueMember   = "ProductId";
            this.slue_ProductId.Properties.View.Columns.Add(new GridColumn()
            {
                FieldName = "Id", Caption = "商品編號", Width = 150, Visible = true, VisibleIndex = 0
            });
            this.slue_ProductId.Properties.View.Columns.Add(new GridColumn()
            {
                FieldName = "ProductName", Caption = "商品名稱", Width = 150, Visible = true, VisibleIndex = 1
            });
            this.slue_ProductId.Properties.View.Columns.Add(new GridColumn()
            {
                FieldName = "CustomerProductName", Caption = "客戶貨品名稱", Width = 150, Visible = true, VisibleIndex = 2
            });
            this.slue_ProductId.Properties.View.Columns.Add(new GridColumn()
            {
                FieldName = "ProductVersion", Caption = "版本", Width = 50, Visible = true, VisibleIndex = 3
            });

            this.slue_ProductId.Properties.DataSource = productManager.SelectProductForXO();
        }