示例#1
0
        //检查数据
        void ucDT_CustomerEditor_Validating(object sender, CancelEventArgs e)
        {
            if (this.IsOwnerEditMode() && (this.Text.Trim() != _LastValue))
            {
                if (this.Text.Trim() != "")
                {
                    DataTable customers = new bllCustomer().FuzzySearch(_CustomerAttributeCodes, this.Text.Trim());

                    if (customers.Rows.Count > 1)//查询出多条记录,打开筛选窗体给用户选取。
                    {
                        frmFuzzyCustomer.Execute(this, customers, _CustomerAttributeCodes, OnSearchCallBack);
                    }
                    else if (customers.Rows.Count == 1)
                    {
                        OnSearchCallBack(customers.Rows[0]);
                    }
                    else
                    {
                        Msg.Warning("客户编号不存在!");
                        e.Cancel = true;
                    }
                }
                else
                {
                    OnSearchCallBack(null);
                }
            }
        }
        public frmCustomer()
        {
            InitializeComponent();
            this.Load += frm_Load;
            //实例化必须,bllBusinessBase必须替换为bll层自己继承的子类(指定正确的dal.DBCode),建议封装重写到项目bll层

            _bll = bll = new bllCustomer();
        }
示例#3
0
        private void Init(string customerCode)
        {
            txt_Customer.EditValue = customerCode;
            txt_EndDate.DateTime   = DateTime.Today;

            if (!String.IsNullOrEmpty(customerCode))
            {
                DataTable dt = new bllCustomer().GetDataByKey(customerCode);
                txtCustomerName.Text = ConvertEx.ToString(dt.Rows[0][tb_Customer.NativeName]); //显示客户名称
                txt_Customer.Enabled = false;                                                  //指定客户,不可重新选择客户
                _byCustomer          = true;
            }
        }
示例#4
0
 private void DoQuery(string content)
 {
     try
     {
         btnQuery.Enabled = false;
         Cursor.Current   = Cursors.WaitCursor;
         DataTable dt = new bllCustomer().FuzzySearch(_AttributeCodes, content);
         gvSummary.GridControl.DataSource = dt;
     }
     finally
     {
         btnQuery.Enabled = true;
         Cursor.Current   = Cursors.Default;
     }
 }
示例#5
0
        protected override void InitializeForm()
        {
            _SummaryView        = new DevGridView(gvSummary); //指定Grid.
            _ActiveEditor       = txtCode;                    //首先获得焦点框
            _KeyEditor          = txtCode;                    //新增时不能修改框
            _DetailGroupControl = gcDetailEditor;             //数据列表区主容器
            _BLL         = new bllCustomer();                 //业务逻辑实例
            _BllCustomer = _BLL as bllCustomer;               //本窗体引用

            base.InitializeForm();

            //绑定相关缓存数据   下拉框 选择列表
            DataBinder.BindingLookupEditDataSource(txt_Attr, DataDictCache.Cache.CustomerAttributes, "NativeName", "AttributeCode");
            DataBinder.BindingLookupEditDataSource(txtBank, DataDictCache.Cache.Bank, "NativeName", "DataCode");
            ucCusAttributes.BindingDataSource(DataDictCache.Cache.CustomerAttributes, "AttributeCode", "NativeName");
        }
        /// <summary>
        /// 获取客户数据
        /// </summary>
        public void DoRetriveData()
        {
            DataTable data = new bllCustomer().GetCustomerByAttributeCodes(_AttributeCodes, _NameWithCode);

            this.DoBindingDataSource(data);
        }
示例#7
0
 private void DoQuery(string content)
 {
     try
     {
         btnQuery.Enabled = false;
         Cursor.Current = Cursors.WaitCursor;
         DataTable dt = new bllCustomer().FuzzySearch(_AttributeCodes, content);
         gvSummary.GridControl.DataSource = dt;
     }
     finally
     {
         btnQuery.Enabled = true;
         Cursor.Current = Cursors.Default;
     }
 }
 /// <summary>
 /// 获取客户数据
 /// </summary>
 public void DoRetriveData()
 {
     DataTable data = new bllCustomer().GetCustomerByAttributeCodes(_AttributeCodes, _NameWithCode);
     this.DoBindingDataSource(data);
 }