Esempio n. 1
0
        private void 添加客户toolStripButton1_Click(object sender, EventArgs e)
        {
            CustomerInfAdd customeradd = new CustomerInfAdd("add", "");

            customeradd.customerInfoFormChange += new CustomerInfAdd.CustomerInfoFormChange(customerAddForm_customerInfoFormChange);
            customeradd.ShowDialog();
        }
Esempio n. 2
0
        private void 属性toolStripButton2_Click(object sender, EventArgs e)
        {
            if (this.dataGridViewCustmer.SelectedRows.Count > 0)
            {
                if (this.dataGridViewCustmer.SelectedRows[0].Cells["客户编号"].Value == null)
                {
                    return;
                }

                string custid = this.dataGridViewCustmer.SelectedRows[0].Cells["客户编号"].Value.ToString().Trim();
                if (custid == "")
                {
                    return;
                }
                CustomerInfAdd cusadd = new CustomerInfAdd("edit", custid);
                cusadd.customerInfoFormChange += new CustomerInfAdd.CustomerInfoFormChange(customerAddForm_customerInfoFormChange);
                cusadd.ShowDialog();
            }
        }
Esempio n. 3
0
 private void 添加客户toolStripButton1_Click(object sender, EventArgs e)
 {
     CustomerInfAdd customeradd = new CustomerInfAdd("add", "");
     customeradd.customerInfoFormChange += new CustomerInfAdd.CustomerInfoFormChange(customerAddForm_customerInfoFormChange);
     customeradd.ShowDialog();
 }
Esempio n. 4
0
        private void 属性toolStripButton2_Click(object sender, EventArgs e)
        {
            if (this.dataGridViewCustmer.SelectedRows.Count > 0)
            {
                if (this.dataGridViewCustmer.SelectedRows[0].Cells["客户编号"].Value == null) return;

                string custid = this.dataGridViewCustmer.SelectedRows[0].Cells["客户编号"].Value.ToString().Trim();
                if (custid == "") return;
                CustomerInfAdd cusadd = new CustomerInfAdd("edit", custid);
                cusadd.customerInfoFormChange += new CustomerInfAdd.CustomerInfoFormChange(customerAddForm_customerInfoFormChange);
                cusadd.ShowDialog();
            }
        }
Esempio n. 5
0
        /// <summary>
        /// 客户编号 文本框 的Enter键
        /// </summary>       
        private void txtCustID_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                TextBox textBox = sender as TextBox;
                string textBoxName = textBox.Text.Trim();
                if (textBoxName == "")
                    return;
                string strSql = "select CustID as 客户编码,CustName as 客户名称,PinYinCode as 拼音助记码,communicateAddr as 通信地址, AtBank as 开户银行 " +
                                "from T_CustomerInf where CustID like '%{0}%' or CustName like '%{1}%' or PinYinCode like '%{2}%'";
                strSql = string.Format(strSql, textBoxName, textBoxName, textBoxName);

                DataTable dt = (new SqlDBConnect()).Get_Dt(strSql);
                if (dt == null || dt.Rows.Count <= 0)
                {
                    DialogResult dialogResult = MessageBox.Show("查找的客户品信息不存在,是否新增客户信息?", "提示信息", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                    if (dialogResult == DialogResult.Yes)
                    {
                        CustomerInfAdd customeradd = new CustomerInfAdd("add", "");
                        customeradd.ShowDialog();
                    }
                    else
                        textBox.Text = "";
                }
                else if (dt.Rows.Count == 1) //只查找到1条匹配记录,直接赋值
                {
                    textBox.Text = dt.Rows[0]["客户编码"].ToString().Trim();
                }
                else
                {
                    FilterInfoForm form = new FilterInfoForm(textBox, dt, "客户编码");
                    form.StartPosition = FormStartPosition.CenterScreen;
                    form.ShowDialog();
                }

                DataBindCustomerInf(textBox.Text.Trim());
            }
        }