Exemplo n.º 1
0
        private void barButtonItem4_ItemClick(object sender, ItemClickEventArgs e)
        {
            object _selectedObj = FocusedItem;

            if (_selectedObj is MD_Title)
            {
                MD_Title      _title    = _selectedObj as MD_Title;
                MD_InputModel _oldModel = _title.FatherObj as MD_InputModel;
                if (_title.TitleType == "MD_INPUTCOLUMES")
                {
                    MD_InputModel_ColumnGroup _group = MenuController.AddInputGroup(_title.FatherObj as MD_InputModel);
                    if (_group != null)
                    {
                        MD_InputModel _model = DAConfig.QueryDataAccess.GetInputModelByName(string.Format("{0}.{1}", _oldModel.NameSpace, _oldModel.ModelName));
                        _title.FatherObj = _model;
                        this.treeList1.FocusedNode.Nodes.Clear();
                        this.treeList1.FocusedNode.HasChildren = true;
                        this.treeList1.FocusedNode.Expanded    = false;
                    }
                    else
                    {
                        XtraMessageBox.Show("添加分组失败!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void bt_DelGroup_ItemClick(object sender, ItemClickEventArgs e)
        {
            object _selectedObj = FocusedItem;

            if (_selectedObj is MD_InputModel_ColumnGroup)
            {
                MD_InputModel_ColumnGroup _group = _selectedObj as MD_InputModel_ColumnGroup;

                if (DAConfig.DataAccess.DelInputModelColumnGroup(_group.ModelID, _group.GroupID))
                {
                    TreeListNode _pnode = this.treeList1.FocusedNode.ParentNode;
                    _pnode.Nodes.Clear();
                    MD_Title      _title    = _pnode.GetValue(this.treeListColumn1) as MD_Title;
                    MD_InputModel _oldModel = _title.FatherObj as MD_InputModel;
                    MD_InputModel _model    = DAConfig.QueryDataAccess.GetInputModelByName(string.Format("{0}.{1}", _oldModel.NameSpace, _oldModel.ModelName));
                    _title.FatherObj   = _model;
                    _pnode.HasChildren = true;
                    _pnode.Expanded    = false;
                }
                else
                {
                    XtraMessageBox.Show("删除分组失败!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Exemplo n.º 3
0
        private static List <MD_InputModel_ColumnGroup> GetInputColumnGroups(MD_InputModel _model, SqlConnection cn)
        {
            List <MD_InputModel_ColumnGroup> _ret = new List <MD_InputModel_ColumnGroup>();
            StringBuilder _sb  = new StringBuilder();
            SqlCommand    _cmd = new SqlCommand(SQL_GetInputColumnGroups, cn);

            _cmd.Parameters.Add("@IVID", _model.ID);
            SqlDataReader _dr = _cmd.ExecuteReader();

            while (_dr.Read())
            {
                MD_InputModel_ColumnGroup _g = new MD_InputModel_ColumnGroup(
                    _dr.IsDBNull(0) ? "" : _dr.GetDecimal(0).ToString(),
                    _model.ID,
                    _dr.IsDBNull(2) ? "" : _dr.GetString(2),
                    _dr.IsDBNull(3) ? 0 : Convert.ToInt32(_dr.GetDecimal(3))
                    );
                _g.GroupType  = _dr.IsDBNull(4) ? "DEFAULT" : _dr.GetString(4).ToUpper();
                _g.AppRegUrl  = _dr.IsDBNull(5) ? "" : _dr.GetString(5);
                _g.GroupParam = _dr.IsDBNull(6) ? "" : _dr.GetString(6);
                _ret.Add(_g);
            }
            _dr.Close();
            return(_ret);
        }
Exemplo n.º 4
0
 public UC_InputColumns(MD_InputModel_ColumnGroup _group)
 {
     InitializeComponent();
     InputGroup = DAConfig.QueryDataAccess.GetInputGroupByID(_group.GroupID);
     InputModel = DAConfig.QueryDataAccess.GetInputModelByID(_group.ModelID);
     InitDataByGroup();
 }
Exemplo n.º 5
0
        private void ShowInputModelColumns(MD_InputModel_ColumnGroup _group)
        {
            UC_InputColumns _uc = new UC_InputColumns(_group);

            _uc.Dock = DockStyle.Fill;
            this.splitContainerControl1.Panel2.Controls.Add(_uc);
            CurrentControl = _uc as IMenuControl;
        }
Exemplo n.º 6
0
 public bool InputModel_MoveColumnToGroup(MD_InputModel_Column Col, MD_InputModel_ColumnGroup InputModel_ColumnGroup)
 {
     try
     {
         OraMetaDataFactroy _of = new OraMetaDataFactroy();
         return(_of.InputModel_MoveColumnToGroup(Col, InputModel_ColumnGroup));
     }
     catch (Exception ex)
     {
         throw new FaultException(ex.Message);
     }
 }
Exemplo n.º 7
0
 public bool SaveInputModelColumnGroup(MD_InputModel_ColumnGroup Group)
 {
     try
     {
         OraMetaDataFactroy _of = new OraMetaDataFactroy();
         return(_of.SaveInputModelColumnGroup(Group));
     }
     catch (Exception ex)
     {
         throw new FaultException(ex.Message);
     }
 }
Exemplo n.º 8
0
 private void ReInit()
 {
     if (InputGroup == null)
     {
         InputModel = DAConfig.QueryDataAccess.GetInputModelByName(string.Format("{0}.{1}", InputModel.NameSpace, InputModel.ModelName));
         InitDataByModel();
     }
     else
     {
         InputGroup = DAConfig.QueryDataAccess.GetInputGroupByID(InputGroup.GroupID);
         InputModel = DAConfig.QueryDataAccess.GetInputModelByID(InputGroup.ModelID);
         InitDataByGroup();
     }
 }
Exemplo n.º 9
0
 public static bool InputModel_MoveColumnToGroup(MD_InputModel_Column _col, MD_InputModel_ColumnGroup InputModelColumnGroup)
 {
     try
     {
         using (SqlConnection cn = SqlHelper.OpenConnection())
         {
             SqlCommand _cmd = new SqlCommand(SQL_InputModel_MoveColumnToGroup, cn);
             _cmd.Parameters.Add("@IVGID", decimal.Parse(InputModelColumnGroup.GroupID));
             _cmd.Parameters.Add("@IVCID", decimal.Parse(_col.ColumnID));
             _cmd.ExecuteNonQuery();
         }
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
Exemplo n.º 10
0
        private MD_InputModel_ColumnGroup GetGroupData()
        {
            MD_InputModel_ColumnGroup _ret = null;

            if (this.InputGroup == null)
            {
                _ret = new MD_InputModel_ColumnGroup("0", this.InputModel.ID, "未分组", 0);
            }
            else
            {
                _ret = this.InputGroup;
            }
            _ret.DisplayTitle = (this.te_Name.EditValue == null) ? "" : this.te_Name.EditValue.ToString();
            _ret.DisplayOrder = (this.te_Order.EditValue == null) ? 0 : Convert.ToInt32(this.te_Order.EditValue);
            _ret.GroupType    = (this.te_GroupType.EditValue == null) ? "DEFAULT" : this.te_GroupType.EditValue.ToString();
            _ret.AppRegUrl    = (this.te_AppRegUrl.EditValue == null) ? "" : this.te_AppRegUrl.EditValue.ToString();
            _ret.GroupParam   = (this.te_Param.EditValue == null) ? "" : this.te_Param.EditValue.ToString();
            _ret.Columns      = this.gridControl1.DataSource as List <MD_InputModel_Column>;
            return(_ret);
        }
Exemplo n.º 11
0
        public void DoSave()
        {
            string _msg = "";

            if (CheckValid(ref _msg))
            {
                MD_InputModel_ColumnGroup _group = GetGroupData();
                if (DAConfig.DataAccess.SaveInputModelColumnGroup(_group))
                {
                    ReInit();
                }
                else
                {
                    XtraMessageBox.Show("保存失败!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                XtraMessageBox.Show(_msg, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemplo n.º 12
0
 public static bool AddNewInputModelGroup(MD_InputModel_ColumnGroup Group)
 {
     try
     {
         using (SqlConnection cn = SqlHelper.OpenConnection())
         {
             SqlCommand _cmd = new SqlCommand(SQL_AddNewInputModelGroup, cn);
             _cmd.Parameters.Add("@IVG_ID", Group.GroupID);
             _cmd.Parameters.Add("@IV_ID", Group.ModelID);
             _cmd.Parameters.Add("@DISPLAYTITLE", Group.DisplayTitle);
             _cmd.Parameters.Add("@DISPLAYORDER", Convert.ToDecimal(Group.DisplayOrder));
             _cmd.Parameters.Add("@GROUPTYPE", string.Empty);
             _cmd.Parameters.Add("@APPREGURL", string.Empty);
             _cmd.Parameters.Add("@GROUPCS", string.Empty);
             _cmd.ExecuteNonQuery();
         }
         return(true);
     }
     catch (Exception e)
     {
         LogWriter.WriteSystemLog(string.Format("插入录入模型的分组[{0}]记录时出错!{1}", Group.GroupID, e.Message), "ERROR");
         return(false);
     }
 }
Exemplo n.º 13
0
        public static MD_InputModel_ColumnGroup AddInputGroup(MD_InputModel _model)
        {
            string _newid = DAConfig.DataAccess.GetNewID();
            var    count  = 0;

            if (_model.Groups == null)
            {
                count = 0;
            }
            else
            {
                count = _model.Groups.Count;
            }
            MD_InputModel_ColumnGroup _group = new MD_InputModel_ColumnGroup(_newid, _model.ID, _newid, count + 1);

            if (DAConfig.DataAccess.AddNewInputModelGroup(_group))
            {
                return(_group);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 14
0
 public bool SaveInputModelColumnGroup(MD_InputModel_ColumnGroup _group)
 {
     return(MetaDataFactroy.SaveInputModelColumnGroup(_group));
 }
Exemplo n.º 15
0
 public bool InputModel_MoveColumnToGroup(MD_InputModel_Column _col, MD_InputModel_ColumnGroup mD_InputModel_ColumnGroup)
 {
     return(MetaDataFactroy.InputModel_MoveColumnToGroup(_col, mD_InputModel_ColumnGroup));
 }
Exemplo n.º 16
0
 public bool AddNewInputModelGroup(MD_InputModel_ColumnGroup Group)
 {
     return(MetaDataFactroy.AddNewInputModelGroup(Group));
 }
Exemplo n.º 17
0
        public static bool SaveInputModelColumnGroup(MD_InputModel_ColumnGroup Group)
        {
            SqlCommand _cmd;

            using (SqlConnection cn = SqlHelper.OpenConnection())
            {
                SqlTransaction _txn = cn.BeginTransaction();
                try
                {
                    if (Group.GroupID != "0")
                    {
                        _cmd = new SqlCommand(SQL_SaveInputModelColumnGroup, cn, _txn);
                        _cmd.Parameters.Add("@DISPLAYTITLE", Group.DisplayTitle);
                        _cmd.Parameters.Add("@GROUPTYPE", Group.GroupType);
                        _cmd.Parameters.Add("@APPREGURL", Group.AppRegUrl);
                        _cmd.Parameters.Add("@GROUPCS", Group.GroupParam);
                        _cmd.Parameters.Add("@DISPLAYORDER", Convert.ToDecimal(Group.DisplayOrder));

                        _cmd.Parameters.Add("@IVG_ID", decimal.Parse(Group.GroupID));
                        _cmd.ExecuteNonQuery();
                    }


                    foreach (MD_InputModel_Column _col in Group.Columns)
                    {
                        _cmd = new SqlCommand(SQL_SaveInputModelColumnGroup_ups, cn, _txn);
                        _cmd.Parameters.Add("@DWDM", _col.DWDM);
                        _cmd.Parameters.Add("@INPUTDEFAULT", _col.DefaultValue);
                        _cmd.Parameters.Add("@INPUTRULE", _col.InputRule);
                        _cmd.Parameters.Add("@CANEDITRULE", _col.CanEditRule);

                        _cmd.Parameters.Add("@CANDISPLAY", (_col.CanDisplay) ? "Y" : "N");
                        _cmd.Parameters.Add("@COLUMNNAME", _col.ColumnName);
                        _cmd.Parameters.Add("@COLUMNORDER", Convert.ToInt32(_col.DisplayOrder));
                        _cmd.Parameters.Add("@COLUMNTYPE", _col.ColumnType);

                        _cmd.Parameters.Add("@READONLY", (_col.ReadOnly) ? (decimal)1 : (decimal)0);
                        _cmd.Parameters.Add("@DISPLAYNAME", _col.DisplayName);
                        _cmd.Parameters.Add("@ISCOMPUTE", (_col.IsCompute) ? (decimal)1 : (decimal)0);
                        _cmd.Parameters.Add("@COLUMNWIDTH", Convert.ToInt32(_col.Width));

                        _cmd.Parameters.Add("@COLUMNHEIGHT", Convert.ToInt32(_col.LineHeight));
                        _cmd.Parameters.Add("@TEXTALIGNMENT", Convert.ToInt32(_col.TextAlign));
                        _cmd.Parameters.Add("@EDITFORMAT", _col.EditFormat);
                        _cmd.Parameters.Add("@DISPLAYFORMAT", _col.DisplayFormat);

                        _cmd.Parameters.Add("@REQUIRED", (_col.Required) ? (decimal)1 : (decimal)0);
                        _cmd.Parameters.Add("@TOOLTIP", _col.ToolTipText);
                        _cmd.Parameters.Add("@DATACHANGEDEVENT", _col.DataChangedEvent);
                        _cmd.Parameters.Add("@MAXLENGTH", Convert.ToDecimal(_col.MaxInputLength));
                        _cmd.Parameters.Add("@DEFAULTSHOW", _col.DefaultShow ? (decimal)1 : (decimal)0);

                        _cmd.Parameters.Add("@IVC_ID", decimal.Parse(_col.ColumnID));
                        _cmd.ExecuteNonQuery();
                    }
                    _txn.Commit();
                    return(true);
                }
                catch (Exception e)
                {
                    _txn.Rollback();
                    return(false);
                }
            }
        }