Esempio n. 1
0
        private void  除客户组3ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("是否确认删除?", "删除确认",
                                MessageBoxButtons.YesNo, MessageBoxIcon.Question) ==
                System.Windows.Forms.DialogResult.Yes)
            {
                BLL.CustomerGroup bll = new BLL.CustomerGroup();

                bool flg = false;

                try
                {
                    flg = bll.Delete(new Guid(this.treeView1.SelectedNode.Name));
                }
                catch (Exception ex)
                {
                    string error = ex.Message;
                    MessageBox.Show("系统出错,请重试!");
                    return;
                }

                if (flg)
                {
                    MessageBox.Show("操作成功!");
                }
                else
                {
                    MessageBox.Show("操作失败!");
                }

                GetData();
            }
        }
Esempio n. 2
0
 public void GetData()
 {
     this.treeView1.Nodes.Clear();
     BLL.CustomerGroup bll = new BLL.CustomerGroup();
     this.treeView1.Nodes.Add(bll.GetCustomerGroup());
     this.treeView1.Nodes[0].Toggle();
 }
Esempio n. 3
0
        private void GetCustomerGroupAndSelected(Guid guid)
        {
            //获得所属客户组
            BLL.Customer      bllCustomer = new BLL.Customer();
            BLL.CustomerGroup bllGroup    = new BLL.CustomerGroup();

            Model.Customer modelCustomer = new Model.Customer();
            modelCustomer = bllCustomer.GetModel(guid);

            List <string> lst = new List <string>();

            bllGroup.GetSelected(ref lst, modelCustomer.parentGUID);

            StringBuilder sb = new StringBuilder();

            for (int i = lst.Count - 1; i > 0; i--)
            {
                sb.Append(lst[i]);
                sb.Append(this.cbxCustomerGroup.BranchSeparator);
            }

            sb.Append(lst[0]);

            this.cbxCustomerGroup.Text         = sb.ToString();
            this.cbxCustomerGroup.SelectedNode =
                (this.cbxCustomerGroup.Nodes.Find(
                     modelCustomer.parentGUID.ToString(), true))[0];

            cbxCustomerGroup_Leave(null, null);

            cbxName.SelectedValue = guid.ToString();
        }
Esempio n. 4
0
        private void frmCustomer_Load(object sender, EventArgs e)
        {
            this.Height = 422;

            BLL.CustomerGroup bll = new BLL.CustomerGroup();
            this.cbxCustomerGroup.Nodes.Add(bll.GetCustomerGroup());
            this.cbxCustomerGroup.Nodes[0].Toggle();
            GetCustomerGroup(_guid);

            //加载省列表
            cbxProvince.DataSource    = DBUtility.XMLHelper.GetProvinces();
            cbxProvince.DisplayMember = "ProvinceName";
            cbxProvince.ValueMember   = "ID";
            cbxProvince.SelectedValue = 27;

            cbxProvince_SelectedIndexChanged(null, null);
            cbxCity_SelectedIndexChanged(null, null);
            this.cbxProvince.SelectedIndexChanged += new System.EventHandler(this.cbxProvince_SelectedIndexChanged);
            this.cbxCity.SelectedIndexChanged     += new System.EventHandler(this.cbxCity_SelectedIndexChanged);

            if (this._model != null)
            {
                GetUpdate();
            }
            else
            {
                GetAdd();
            }
        }
Esempio n. 5
0
        private void frmCustomer_Load(object sender, EventArgs e)
        {
            this.Height = 422;

            BLL.CustomerGroup bll = new BLL.CustomerGroup();
            this.cbxCustomerGroup.Nodes.Add(bll.GetCustomerGroup());
            this.cbxCustomerGroup.Nodes[0].Toggle();
            GetCustomerGroup(_guid);

            //加载省列表
            cbxProvince.DataSource = DBUtility.XMLHelper.GetProvinces();
            cbxProvince.DisplayMember = "ProvinceName";
            cbxProvince.ValueMember = "ID";
            cbxProvince.SelectedValue = 27;

            cbxProvince_SelectedIndexChanged(null, null);
            cbxCity_SelectedIndexChanged(null, null);
            this.cbxProvince.SelectedIndexChanged += new System.EventHandler(this.cbxProvince_SelectedIndexChanged);
            this.cbxCity.SelectedIndexChanged += new System.EventHandler(this.cbxCity_SelectedIndexChanged);

            if (this._model != null)
            {
                GetUpdate();
            }
            else
            {
                GetAdd();
            }
        }
Esempio n. 6
0
 public void GetData()
 {
     this.treeView1.Nodes.Clear();
     BLL.CustomerGroup bll = new BLL.CustomerGroup();
     this.treeView1.Nodes.Add(bll.GetCustomerGroup());
     this.treeView1.Nodes[0].Toggle();
 }
Esempio n. 7
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            errorProvider1.Clear();

            if (string.IsNullOrEmpty(this.txtName.Text.Trim()))
            {
                errorProvider1.SetError(txtName, "客户组名称不能为空!");
                return;
            }

            if (!this.cbxTreeCustomerGroup.ValidateText())
            {
                errorProvider1.SetError(cbxTreeCustomerGroup, 
                    "必须选择所属客户组!");
                return;
            }

            BLL.CustomerGroup bll = new BLL.CustomerGroup();
            Model.CustomerGroup model = new Model.CustomerGroup();
            model.cName = txtName.Text.Trim();
            model.parentGUID = new Guid(this.cbxTreeCustomerGroup.SelectedNode.Name);

            bool flg = false;

            try
            {
                if (this.Text == "新增客户组")
                {
                    flg = bll.Add(model);
                }
                else
                {
                    model.GUID = _model.GUID;
                    flg = bll.Update(model);
                }

            }
            catch (Exception ex)
            {
                string error = ex.Message;
                MessageBox.Show("系统出错,请重试!");
                return;
            }

            if (flg)
            {
                MessageBox.Show("操作成功!");
            }
            else
            {
                MessageBox.Show("操作失败!");
            }

            this.Close();
            frmMain.Main.DockCustomerGroup.GetData();
        }
Esempio n. 8
0
 private void frmAddCustomerGroup_Load(object sender, EventArgs e)
 {
     BLL.CustomerGroup bll = new BLL.CustomerGroup();
     this.cbxTreeCustomerGroup.Nodes.Add(bll.GetCustomerGroup());
     this.cbxTreeCustomerGroup.Nodes[0].Toggle();
     if (this._model != null)
     {
         GetUpdate();
     }
 }
Esempio n. 9
0
 private void frmAddCustomerGroup_Load(object sender, EventArgs e)
 {
     BLL.CustomerGroup bll = new BLL.CustomerGroup();
     this.cbxTreeCustomerGroup.Nodes.Add(bll.GetCustomerGroup());
     this.cbxTreeCustomerGroup.Nodes[0].Toggle();
     if (this._model != null)
     {
         GetUpdate();
     }
 }
Esempio n. 10
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            errorProvider1.Clear();

            if (string.IsNullOrEmpty(this.txtName.Text.Trim()))
            {
                errorProvider1.SetError(txtName, "客户组名称不能为空!");
                return;
            }

            if (!this.cbxTreeCustomerGroup.ValidateText())
            {
                errorProvider1.SetError(cbxTreeCustomerGroup,
                                        "必须选择所属客户组!");
                return;
            }

            BLL.CustomerGroup   bll   = new BLL.CustomerGroup();
            Model.CustomerGroup model = new Model.CustomerGroup();
            model.cName      = txtName.Text.Trim();
            model.parentGUID = new Guid(this.cbxTreeCustomerGroup.SelectedNode.Name);

            bool flg = false;

            try
            {
                if (this.Text == "新增客户组")
                {
                    flg = bll.Add(model);
                }
                else
                {
                    model.GUID = _model.GUID;
                    flg        = bll.Update(model);
                }
            }
            catch (Exception ex)
            {
                string error = ex.Message;
                MessageBox.Show("系统出错,请重试!");
                return;
            }

            if (flg)
            {
                MessageBox.Show("操作成功!");
            }
            else
            {
                MessageBox.Show("操作失败!");
            }

            this.Close();
            frmMain.Main.DockCustomerGroup.GetData();
        }
Esempio n. 11
0
        /// <summary>
        /// 获取条件
        /// </summary>
        /// <returns></returns>
        private void GetWhere(ref List <string> lst, Guid guid)
        {
            lst.Add(string.Format("'{0}'", guid));

            BLL.CustomerGroup   bll   = new BLL.CustomerGroup();
            Model.CustomerGroup model = new Model.CustomerGroup();

            DataTable dt = bll.GetList(string.Format("parentGUID = '{0}'", guid)).Tables[0];

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                GetWhere(ref lst, new Guid(dt.Rows[i][0].ToString()));
            }
        }
Esempio n. 12
0
        /// <summary>
        /// 获取条件
        /// </summary>
        /// <returns></returns>
        private void GetWhere(ref List<string> lst, Guid guid)
        {
            lst.Add(string.Format("'{0}'", guid));

            BLL.CustomerGroup bll = new BLL.CustomerGroup();
            Model.CustomerGroup model = new Model.CustomerGroup();

            DataTable dt = bll.GetList(string.Format("parentGUID = '{0}'", guid)).Tables[0];

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                GetWhere(ref lst, new Guid(dt.Rows[i][0].ToString()));
            }
        }
Esempio n. 13
0
        private void frmService_Load(object sender, EventArgs e)
        {
            BLL.CustomerGroup bll = new BLL.CustomerGroup();
            this.cbxCustomerGroup.Nodes.Add(bll.GetCustomerGroup());
            this.cbxCustomerGroup.Nodes[0].Toggle();
            if (_guid != Guid.Empty)
            {
                GetCustomerGroup(_guid);
            }

            if (this._model != null)
            {
                GetUpdate();
            }
            else
            {
                GetAdd();
            }
        }
Esempio n. 14
0
        private void frmService_Load(object sender, EventArgs e)
        {
            BLL.CustomerGroup bll = new BLL.CustomerGroup();
            this.cbxCustomerGroup.Nodes.Add(bll.GetCustomerGroup());
            this.cbxCustomerGroup.Nodes[0].Toggle();
            if (_guid != Guid.Empty)
            {
                GetCustomerGroup(_guid);
            }

            if (this._model != null)
            {
                GetUpdate();
            }
            else
            {
                GetAdd();
            }
        }
Esempio n. 15
0
        /// <summary>
        /// 或许所属客户组
        /// </summary>
        /// <param name="guid"></param>
        private void GetCustomerGroup(Guid guid)
        {
            BLL.CustomerGroup bll = new BLL.CustomerGroup();
            List <string>     lst = new List <string>();

            bll.GetSelected(ref lst, guid);

            StringBuilder sb = new StringBuilder();

            for (int i = lst.Count - 1; i > 0; i--)
            {
                sb.Append(lst[i]);
                sb.Append(this.cbxCustomerGroup.BranchSeparator);
            }

            sb.Append(lst[0]);

            this.cbxCustomerGroup.Text         = sb.ToString();
            this.cbxCustomerGroup.SelectedNode = (this.cbxCustomerGroup.Nodes.Find(guid.ToString(), true))[0];
        }
Esempio n. 16
0
        private void GetUpdate()
        {
            this.Text = "编辑客户组";
            txtName.Text = _model.cName;
            BLL.CustomerGroup bll = new BLL.CustomerGroup();
            List<string> lst = new List<string>();
            bll.GetParentSelected(ref lst, _model.GUID);

            StringBuilder sb = new StringBuilder();

            for (int i = lst.Count - 1; i > 0; i--)
            {
                sb.Append(lst[i]);
                sb.Append(this.cbxTreeCustomerGroup.BranchSeparator);
            }

            sb.Append(lst[0]);

            this.cbxTreeCustomerGroup.Text = sb.ToString();
            this.cbxTreeCustomerGroup.SelectedNode = bll.GetParentSelectedNode(this.cbxTreeCustomerGroup.Nodes, _model.GUID);
        }
Esempio n. 17
0
        private void GetUpdate()
        {
            this.Text    = "编辑客户组";
            txtName.Text = _model.cName;
            BLL.CustomerGroup bll = new BLL.CustomerGroup();
            List <string>     lst = new List <string>();

            bll.GetParentSelected(ref lst, _model.GUID);

            StringBuilder sb = new StringBuilder();

            for (int i = lst.Count - 1; i > 0; i--)
            {
                sb.Append(lst[i]);
                sb.Append(this.cbxTreeCustomerGroup.BranchSeparator);
            }

            sb.Append(lst[0]);

            this.cbxTreeCustomerGroup.Text         = sb.ToString();
            this.cbxTreeCustomerGroup.SelectedNode = bll.GetParentSelectedNode(this.cbxTreeCustomerGroup.Nodes, _model.GUID);
        }
Esempio n. 18
0
        /// <summary>
        /// 或许所属客户组
        /// </summary>
        /// <param name="guid"></param>
        private void GetCustomerGroup(Guid guid)
        {
            BLL.CustomerGroup bll = new BLL.CustomerGroup();
            List<string> lst = new List<string>();
            BLL.Customer bllCustomer = new BLL.Customer();
            Model.Customer modelCustomer = bllCustomer.GetModel(guid);

            bll.GetSelected(ref lst, modelCustomer.parentGUID);

            StringBuilder sb = new StringBuilder();

            for (int i = lst.Count - 1; i > 0; i--)
            {
                sb.Append(lst[i]);
                sb.Append(this.cbxCustomerGroup.BranchSeparator);
            }

            sb.Append(lst[0]);

            this.cbxCustomerGroup.Text = sb.ToString();
            this.cbxCustomerGroup.SelectedNode = (this.cbxCustomerGroup.Nodes.Find(modelCustomer.parentGUID.ToString(), true))[0];
        }
Esempio n. 19
0
        private void GetCustomerGroupAndSelected(Guid guid)
        {
            //获得所属客户组
            BLL.Customer bllCustomer = new BLL.Customer();
            BLL.CustomerGroup bllGroup = new BLL.CustomerGroup();

            Model.Customer modelCustomer = new Model.Customer();
            modelCustomer = bllCustomer.GetModel(guid);

            List<string> lst = new List<string>();
            bllGroup.GetSelected(ref lst, modelCustomer.parentGUID);

            StringBuilder sb = new StringBuilder();

            for (int i = lst.Count - 1; i > 0; i--)
            {
                sb.Append(lst[i]);
                sb.Append(this.cbxCustomerGroup.BranchSeparator);
            }

            sb.Append(lst[0]);

            this.cbxCustomerGroup.Text = sb.ToString();
            this.cbxCustomerGroup.SelectedNode =
                (this.cbxCustomerGroup.Nodes.Find(
                modelCustomer.parentGUID.ToString(), true))[0];

            cbxCustomerGroup_Leave(null, null);

            cbxName.SelectedValue = guid.ToString();
        }
Esempio n. 20
0
        /// <summary>
        /// 修改信息初始化
        /// </summary>
        private void GetUpdate()
        {
            this.Text = "编辑客户信息";
            BLL.Customer   bll   = new BLL.Customer();
            Model.Customer model = bll.GetModel(_model.GUID);
            this.llblAddService.Visible = true;
            this.llblService.Visible    = true;

            //赋值
            BLL.Argument bllArgument = new BLL.Argument();
            DataTable    dt          = bllArgument.GetList("type = '客户编号'").Tables[0];

            string str = dt.Rows[0][1].ToString();

            txtNO.Text   = str + model.cNO;
            txtName.Text = model.cName;

            //获得所属客户组
            BLL.CustomerGroup bllGroup = new BLL.CustomerGroup();
            List <string>     lst      = new List <string>();

            bllGroup.GetSelected(ref lst, model.parentGUID);

            StringBuilder sb = new StringBuilder();

            for (int i = lst.Count - 1; i > 0; i--)
            {
                sb.Append(lst[i]);
                sb.Append(this.cbxCustomerGroup.BranchSeparator);
            }

            sb.Append(lst[0]);

            this.cbxCustomerGroup.Text         = sb.ToString();
            this.cbxCustomerGroup.SelectedNode =
                (this.cbxCustomerGroup.Nodes.Find(
                     model.parentGUID.ToString(), true))[0];

            cbxIsGov.SelectedIndex = Convert.ToInt32(!model.isGov);
            txtTrade.Text          = model.trade;
            txtMan.Text            = model.cMan;
            txtTel.Text            = model.Tel;
            txtFax.Text            = model.fax;
            txtEmail.Text          = model.email;
            cbxProvince.Text       = model.province;
            cbxCity.Text           = model.city;
            cbxDistrict.Text       = model.district;
            txtQQ.Text             = model.QQ;
            txtMode.Text           = model.mode;
            txtScope.Text          = model.scope;
            txtProduct.Text        = model.product;
            txtAddress.Text        = model.addresss;
            cbxStage.Text          = model.cStage;
            cbxType.Text           = model.cType;
            cbxLevel.Text          = model.cLevel;
            cbxStatus.Text         = model.cStatus;
            txtLink1.Text          = model.link1;
            txtTel1.Text           = model.tel1;
            txtLink2.Text          = model.link2;
            txtTel2.Text           = model.tel2;
        }
Esempio n. 21
0
        private void 删除客户组3ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("是否确认删除?", "删除确认",
                MessageBoxButtons.YesNo, MessageBoxIcon.Question) ==
                System.Windows.Forms.DialogResult.Yes)
            {
                BLL.CustomerGroup bll = new BLL.CustomerGroup();

                bool flg = false;

                try
                {
                    flg = bll.Delete(new Guid(this.treeView1.SelectedNode.Name));
                }
                catch (Exception ex)
                {
                    string error = ex.Message;
                    MessageBox.Show("系统出错,请重试!");
                    return;
                }

                if (flg)
                {
                    MessageBox.Show("操作成功!");
                }
                else
                {
                    MessageBox.Show("操作失败!");
                }

                GetData();
            }
        }
Esempio n. 22
0
        /// <summary>
        /// 修改信息初始化
        /// </summary>
        private void GetUpdate()
        {
            this.Text = "编辑客户信息";
            BLL.Customer bll = new BLL.Customer();
            Model.Customer model = bll.GetModel(_model.GUID);
            this.llblAddService.Visible = true;
            this.llblService.Visible = true;

            //赋值
            BLL.Argument bllArgument = new BLL.Argument();
            DataTable dt = bllArgument.GetList("type = '客户编号'").Tables[0];

            string str = dt.Rows[0][1].ToString();

            txtNO.Text = str + model.cNO;
            txtName.Text = model.cName;

            //获得所属客户组
            BLL.CustomerGroup bllGroup = new BLL.CustomerGroup();
            List<string> lst = new List<string>();
            bllGroup.GetSelected(ref lst, model.parentGUID);

            StringBuilder sb = new StringBuilder();

            for (int i = lst.Count - 1; i > 0; i--)
            {
                sb.Append(lst[i]);
                sb.Append(this.cbxCustomerGroup.BranchSeparator);
            }

            sb.Append(lst[0]);

            this.cbxCustomerGroup.Text = sb.ToString();
            this.cbxCustomerGroup.SelectedNode = 
                (this.cbxCustomerGroup.Nodes.Find(
                model.parentGUID.ToString(), true))[0];

            cbxIsGov.SelectedIndex = Convert.ToInt32(!model.isGov);
            txtTrade.Text = model.trade;
            txtMan.Text = model.cMan;
            txtTel.Text = model.Tel;
            txtFax.Text = model.fax;
            txtEmail.Text = model.email;
            cbxProvince.Text = model.province;
            cbxCity.Text = model.city;
            cbxDistrict.Text = model.district;
            txtQQ.Text = model.QQ;
            txtMode.Text = model.mode;
            txtScope.Text = model.scope;
            txtProduct.Text = model.product;
            txtAddress.Text = model.addresss;
            cbxStage.Text = model.cStage;
            cbxType.Text = model.cType;
            cbxLevel.Text = model.cLevel;
            cbxStatus.Text = model.cStatus;
            txtLink1.Text = model.link1;
            txtTel1.Text = model.tel1;
            txtLink2.Text = model.link2;
            txtTel2.Text = model.tel2;
        }