Esempio n. 1
0
        /// <summary>
        /// 编辑一条记录
        /// </summary>
        /// <param name="_model"></param>
        /// <returns></returns>
        public bool Edit(CarpenterEntity.ProgramControlEntity _model)
        {
            StringBuilder strSql = new StringBuilder( );

            strSql.Append("UPDATE MOXFOR SET ");
            strSql.Append("FOR001=@FOR001,");
            strSql.Append("FOR002=@FOR002,");
            strSql.Append("FOR003=@FOR003,");
            strSql.Append("FOR004=@FOR004 ");
            strSql.Append("WHERE idx=@idx");
            SqlParameter [] parameter =
            {
                new SqlParameter("@FOR001", SqlDbType.NVarChar, 20),
                new SqlParameter("@FOR002", SqlDbType.NVarChar, 20),
                new SqlParameter("@FOR003", SqlDbType.NChar,    10),
                new SqlParameter("@FOR004", SqlDbType.NVarChar, 20),
                new SqlParameter("@idx",    SqlDbType.Int)
            };
            parameter [0].Value = _model.FOR001;
            parameter [1].Value = _model.FOR002;
            parameter [2].Value = _model.FOR003;
            parameter [3].Value = _model.FOR004;
            parameter [4].Value = _model.idx;

            int row = SqlHelper.ExecuteNonQuery(strSql.ToString( ), parameter);

            if (row > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 2
0
        public ProgramControlEdit(string text, CarpenterEntity.ProgramControlEntity _model, string sign)
        {
            InitializeComponent( );

            this.Text   = text;
            this._model = _model;
            this.sign   = sign;

            comType.Items.Add("0");
            comType.Items.Add("1");
        }
Esempio n. 3
0
        public FormProgramControl( )
        {
            InitializeComponent( );

            _bll   = new CarpenterBll.Bll.ProgramControlBll( );
            _model = new CarpenterEntity.ProgramControlEntity( );

            barMenu.LinksPersistInfo.RemoveAt(toolExport.Id);
            barMenu.LinksPersistInfo.RemoveAt(toolPrint.Id);
            barMenu.LinksPersistInfo.RemoveAt(toolCancel.Id);
            barMenu.LinksPersistInfo.RemoveAt(toolSave.Id);

            Utility.GridViewMoHuSelect.SetFilter(gridView1);
            FieldInfo fi = typeof(XPaint).GetField("graphics", BindingFlags.Static | BindingFlags.NonPublic);

            fi.SetValue(null, new DrawXPaint( ));
        }
Esempio n. 4
0
        /// <summary>
        /// 增加一条记录
        /// </summary>
        /// <param name="_model"></param>
        /// <returns></returns>
        public int Add(CarpenterEntity.ProgramControlEntity _model)
        {
            StringBuilder strSql = new StringBuilder( );

            strSql.Append("INSERT INTO MOXFOR (");
            strSql.Append("FOR001,FOR002,FOR003,FOR004) ");
            strSql.Append("VALUES (");
            strSql.Append("@FOR001,@FOR002,@FOR003,@FOR004);");
            strSql.Append("SELECT SCOPE_IDENTITY();");
            SqlParameter [] parameter =
            {
                new SqlParameter("@FOR001", SqlDbType.NVarChar, 20),
                new SqlParameter("@FOR002", SqlDbType.NVarChar, 20),
                new SqlParameter("@FOR003", SqlDbType.NChar,    10),
                new SqlParameter("@FOR004", SqlDbType.NVarChar, 20)
            };
            parameter [0].Value = _model.FOR001;
            parameter [1].Value = _model.FOR002;
            parameter [2].Value = _model.FOR003;
            parameter [3].Value = _model.FOR004;

            return(SqlHelper.ExecuteSqlReturnId(strSql.ToString( ), parameter));
        }
Esempio n. 5
0
 /// <summary>
 /// 编辑一条记录
 /// </summary>
 /// <param name="_model"></param>
 /// <returns></returns>
 public bool Edit(CarpenterEntity.ProgramControlEntity _model)
 {
     return(_dao.Edit(_model));
 }
Esempio n. 6
0
 /// <summary>
 /// 增加一条记录
 /// </summary>
 /// <param name="_model"></param>
 /// <returns></returns>
 public int Add(CarpenterEntity.ProgramControlEntity _model)
 {
     return(_dao.Add(_model));
 }