Example #1
0
        /// <summary>
        /// 添加
        /// </summary>
        private void add()
        {
            try
            {
                if (check())
                {
                    Area area = new Area();

                    area.A_Code   = A_Code.Text;
                    area.A_Name   = A_Name.Text;
                    area.A_Parent = A_Parent.SelectedIndex < 0 ? "" : A_Parent.SelectedValue.ToString();

                    AreaBLL areabll = new AreaBLL();
                    if (areabll.Exists(area.A_Code))
                    {
                        untCommon.InfoMsg("区域编码已存在!");
                    }
                    else
                    {
                        if (areabll.Add(area) > 0)
                        {
                            frmParent.loadArea();
                            untCommon.InfoMsg("添加成功!");
                        }
                        else
                        {
                            untCommon.InfoMsg("添加失败!");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                untCommon.InfoMsg("区域管理添加数据异常:" + ex.Message);
            }
        }