Exemplo n.º 1
0
        public FormArt( )
        {
            InitializeComponent( );

            model    = new LineProductMesEntityu.ArtEntity( );
            body     = new LineProductMesEntityu.ArsEntity( );
            _bll     = new LineProductMesBll.Bll.ArtBll( );
            _bodyOne = new LineProductMesEntityu.AruEntity( );

            //获取UI线程同步上下文
            m_SyncContext = SynchronizationContext.Current;

            GridViewMoHuSelect.SetFilter(new DevExpress.XtraGrid.Views.Grid.GridView [] { gridView1, gridView2, gridView3, View1, View4, View2, View3, gridView4 });
            GrivColumnStyle.setColumnStyle(new DevExpress.XtraGrid.Views.Grid.GridView [] { gridView1, gridView2, gridView3, View1, View4, View2, View3, gridView4 });
            FieldInfo fi = typeof(XPaint).GetField("graphics", BindingFlags.Static | BindingFlags.NonPublic);

            fi.SetValue(null, new DrawXPaint( ));

            ToolBarContain.ToolbarsC(barTool, new DevExpress.XtraBars.BarButtonItem [] { toolCancellation, toolExamin });

            Query( );
            controlUnEnable( );
            controlClear( );
            InitData( );
        }
Exemplo n.º 2
0
        /// <summary>
        /// 保存数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Save(LineProductMesEntityu.ArsEntity model, DataTable table, Hashtable haTable)
        {
            Dictionary <object, object> SQLString = new Dictionary <object, object> ( );

            AddHeader(SQLString, model);

            if (table != null && table.Rows.Count > 0)
            {
                LineProductMesEntityu.ArtEntity body = new LineProductMesEntityu.ArtEntity( );
                body.ART001 = model.ARS001;
                foreach (DataRow row in table.Rows)
                {
                    body.ART011 = row ["ART011"].ToString( );
                    body.ART002 = row ["ART002"].ToString( );
                    body.ART003 = row ["ART003"].ToString( );
                    body.ART004 = string.IsNullOrEmpty(row ["ART004"].ToString( )) == true ? 0 : Convert.ToDecimal(row ["ART004"].ToString( ));
                    body.ART005 = string.IsNullOrEmpty(row ["ART005"].ToString( )) == true ? 0 : Convert.ToDecimal(row ["ART005"].ToString( ));
                    body.ART006 = row ["ART006"].ToString( );
                    body.ART007 = row ["ART007"].ToString( );
                    //body . ART008 = row [ "ART008" ] . ToString ( );
                    body.ART009 = row ["ART009"].ToString( );
                    body.ART010 = string.IsNullOrEmpty(row ["ART010"].ToString( )) == true ? "否" : row ["ART010"].ToString( );
                    body.ART012 = string.IsNullOrEmpty(row ["ART012"].ToString( )) == true ? 0 : Convert.ToInt32(row ["ART012"].ToString( ));
                    body.ART013 = row ["ART013"].ToString( );
                    AddBody(SQLString, body);
                    if (haTable != null && haTable.Count > 0)
                    {
                        DataTable tableView = ( DataTable )haTable [body.ART001 + body.ART011];
                        if (tableView != null && tableView.Rows.Count > 0)
                        {
                            LineProductMesEntityu.AruEntity bodyOne = new LineProductMesEntityu.AruEntity( );
                            bodyOne.ARU001 = body.ART001;
                            bodyOne.ARU002 = body.ART011;
                            foreach (DataRow rows in tableView.Rows)
                            {
                                bodyOne.ARU003 = rows ["ARU003"].ToString( );
                                bodyOne.ARU004 = rows ["ARU004"].ToString( );
                                AddBodyOne(SQLString, bodyOne);
                            }
                        }
                    }
                }
            }

            return(SqlHelper.ExecuteSqlTranDic(SQLString));
        }
Exemplo n.º 3
0
        void EditBodyOne(Dictionary <object, object> SQLString, LineProductMesEntityu.AruEntity model)
        {
            StringBuilder strSql = new StringBuilder( );

            strSql.Append("update MIKARU set ");
            strSql.Append("ARU003=@ARU003,");
            strSql.Append("ARU004=@ARU004 ");
            strSql.Append(" where idx=@idx");
            SqlParameter [] parameters =
            {
                new SqlParameter("@ARU004", SqlDbType.NVarChar, 50),
                new SqlParameter("@ARU003", SqlDbType.NChar,    10),
                new SqlParameter("@idx",    SqlDbType.Int, 4)
            };
            parameters [0].Value = model.ARU004;
            parameters [1].Value = model.ARU003;
            parameters [2].Value = model.idx;
            SQLString.Add(strSql, parameters);
        }
Exemplo n.º 4
0
        void AddBodyOne(Dictionary <object, object> SQLString, LineProductMesEntityu.AruEntity model)
        {
            StringBuilder strSql = new StringBuilder( );

            strSql.Append("insert into MIKARU(");
            strSql.Append("ARU001,ARU002,ARU003,ARU004,ARU005)");
            strSql.Append(" values (");
            strSql.Append("@ARU001,@ARU002,@ARU003,@ARU004,@ARU005)");
            SqlParameter [] parameters =
            {
                new SqlParameter("@ARU001", SqlDbType.NVarChar, 20),
                new SqlParameter("@ARU002", SqlDbType.NVarChar, 20),
                new SqlParameter("@ARU003", SqlDbType.NVarChar, 20),
                new SqlParameter("@ARU004", SqlDbType.NVarChar, 50),
                new SqlParameter("@ARU005", SqlDbType.NChar, 10)
            };
            parameters [0].Value = model.ARU001;
            parameters [1].Value = model.ARU002;
            parameters [2].Value = model.ARU003;
            parameters [3].Value = model.ARU004;
            parameters [4].Value = model.ARU005;
            SQLString.Add(strSql, parameters);
        }