Exemplo n.º 1
0
        void add_pqcg(Hashtable SQLString, StringBuilder strSql, MulaolaoLibrary.StandardAuditForCIEntity model, string logins)
        {
            strSql = new StringBuilder( );
            strSql.Append("insert into R_PQCI(");
            strSql.Append("CI001,CI002,CI003,CI004,CI005,CI006,CI007,CI008,CI009,CI010,CI011,CI012,CI013,CI014,CI015,CI016,CI017,CI018,CI019,CI020,CI021,CI024)");
            strSql.Append(" values (");
            strSql.Append("@CI001,@CI002,@CI003,@CI004,@CI005,@CI006,@CI007,@CI008,@CI009,@CI010,@CI011,@CI012,@CI013,@CI014,@CI015,@CI016,@CI017,@CI018,@CI019,@CI020,@CI021,@CI024)");
            SqlParameter [] parameters =
            {
                new SqlParameter("@CI001", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI002", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI003", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI004", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI005", SqlDbType.Date,       3),
                new SqlParameter("@CI006", SqlDbType.Date,       3),
                new SqlParameter("@CI007", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI008", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI009", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI010", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI011", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI012", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI013", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI014", SqlDbType.Date,       3),
                new SqlParameter("@CI015", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI016", SqlDbType.Date,       3),
                new SqlParameter("@CI017", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI018", SqlDbType.Date,       3),
                new SqlParameter("@CI019", SqlDbType.Int,        4),
                new SqlParameter("@CI020", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI021", SqlDbType.NVarChar, 100),
                new SqlParameter("@CI024", SqlDbType.Int, 4)
            };
            parameters [0].Value  = model.CI001;
            parameters [1].Value  = model.CI002;
            parameters [2].Value  = model.CI003;
            parameters [3].Value  = model.CI004;
            parameters [4].Value  = model.CI005;
            parameters [5].Value  = model.CI006;
            parameters [6].Value  = model.CI007;
            parameters [7].Value  = model.CI008;
            parameters [8].Value  = model.CI009;
            parameters [9].Value  = model.CI010;
            parameters [10].Value = model.CI011;
            parameters [11].Value = model.CI012;
            parameters [12].Value = model.CI013;
            parameters [13].Value = model.CI014;
            parameters [14].Value = model.CI015;
            parameters [15].Value = model.CI016;
            parameters [16].Value = model.CI017;
            parameters [17].Value = model.CI018;
            parameters [18].Value = model.CI019;
            parameters [19].Value = model.CI020;
            parameters [20].Value = model.CI021;
            parameters [21].Value = model.CI024;

            SQLString.Add(strSql, parameters);
            //SQLString . Add ( Drity . DrityOfComparation ( "R_482" ,"滚、喷、涂漆生产首件标准样审核确认记录表(R_482)" ,logins ,Drity . GetDt ( ) ,model . CI001 ,strSql . ToString ( ) . Replace ( "'" ,"''" ) ,"新增" ,"新增" ) ,null );
        }
Exemplo n.º 2
0
        public FormStandardAuditFor( )
        {
            InitializeComponent( );

            _ch       = new MulaolaoLibrary.StandardAuditForCHEntity( );
            _ci       = new MulaolaoLibrary.StandardAuditForCIEntity( );
            _bll      = new MulaolaoBll.Bll.StandardAuditForBll( );
            tableView = new DataTable( );
            tablePro  = new DataTable( );
            printOne  = new DataTable( );
            printTwo  = new DataTable( );
            MulaolaoBll.UserInfoMation.tableName = this.Name;

            GridViewMoHuSelect.SetFilter(resPro);
            GridViewMoHuSelect.SetFilter(bandedGridView1);
            GrivColumnStyle.setColumnStyle(new DevExpress.XtraGrid.Views.Grid.GridView [] { bandedGridView1 });
            Power(this);
            UnEnable( );

            tablePro             = _bll.getPro( );
            lupPro.DataSource    = tablePro;
            lupPro.DisplayMember = "CI012";
            lupPro.ValueMember   = "CI012";

            DataTable dt = _bll.getUser( );

            if (dt != null && dt.Rows.Count > 0)
            {
                DataTable da = dt.Copy( ).DefaultView.ToTable(true, "CH003");
                for (int i = 0; i < da.Rows.Count; i++)
                {
                    cmbUserOne.Properties.Items.Add(da.Rows [i] ["CH003"].ToString( ));
                }
                da = dt.Copy( ).DefaultView.ToTable(true, "CH004");
                for (int i = 0; i < da.Rows.Count; i++)
                {
                    cmbUserTwo.Properties.Items.Add(da.Rows [i] ["CH004"].ToString( ));
                }
                da = dt.Copy( ).DefaultView.ToTable(true, "CH005");
                for (int i = 0; i < da.Rows.Count; i++)
                {
                    cmbUserTre.Properties.Items.Add(da.Rows [i] ["CH005"].ToString( ));
                }
                da = dt.Copy( ).DefaultView.ToTable(true, "CH006");
                for (int i = 0; i < da.Rows.Count; i++)
                {
                    cmbUserFor.Properties.Items.Add(da.Rows [i] ["CH006"].ToString( ));
                }
            }
        }
Exemplo n.º 3
0
        void delete_pqcg(Hashtable SQLString, StringBuilder strSql, MulaolaoLibrary.StandardAuditForCIEntity model, string logins)
        {
            strSql = new StringBuilder( );
            strSql.Append("delete from R_PQCI ");
            strSql.Append(" where idx=@idx");
            SqlParameter [] parameters =
            {
                new SqlParameter("@idx", SqlDbType.Int, 4)
            };
            parameters [0].Value = model.idx;

            SQLString.Add(strSql, parameters);
            //SQLString . Add ( Drity . DrityOfComparation ( "R_482" ,"滚、喷、涂漆生产首件标准样审核确认记录表(R_482)" ,logins ,Drity . GetDt ( ) ,model . CI001 ,strSql . ToString ( ) . Replace ( "'" ,"''" ) ,"删除" ,"编辑删除" ) ,null );
        }
Exemplo n.º 4
0
        void edit_pqcg(Hashtable SQLString, StringBuilder strSql, MulaolaoLibrary.StandardAuditForCIEntity model, string logins)
        {
            strSql = new StringBuilder( );
            strSql.Append("update R_PQCI set ");
            strSql.Append("CI001=@CI001,");
            strSql.Append("CI002=@CI002,");
            strSql.Append("CI003=@CI003,");
            strSql.Append("CI004=@CI004,");
            strSql.Append("CI005=@CI005,");
            strSql.Append("CI006=@CI006,");
            strSql.Append("CI007=@CI007,");
            strSql.Append("CI008=@CI008,");
            strSql.Append("CI009=@CI009,");
            strSql.Append("CI010=@CI010,");
            strSql.Append("CI011=@CI011,");
            strSql.Append("CI012=@CI012,");
            strSql.Append("CI013=@CI013,");
            strSql.Append("CI014=@CI014,");
            strSql.Append("CI015=@CI015,");
            strSql.Append("CI016=@CI016,");
            strSql.Append("CI017=@CI017,");
            strSql.Append("CI018=@CI018,");
            strSql.Append("CI019=@CI019,");
            strSql.Append("CI020=@CI020,");
            strSql.Append("CI021=@CI021,");
            strSql.Append("CI024=@CI024 ");
            strSql.Append(" where idx=@idx");
            SqlParameter [] parameters =
            {
                new SqlParameter("@CI001", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI002", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI003", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI004", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI005", SqlDbType.Date,       3),
                new SqlParameter("@CI006", SqlDbType.Date,       3),
                new SqlParameter("@CI007", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI008", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI009", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI010", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI011", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI012", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI013", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI014", SqlDbType.Date,       3),
                new SqlParameter("@CI015", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI016", SqlDbType.Date,       3),
                new SqlParameter("@CI017", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI018", SqlDbType.Date,       3),
                new SqlParameter("@CI019", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI020", SqlDbType.NVarChar,  20),
                new SqlParameter("@CI021", SqlDbType.NVarChar, 100),
                new SqlParameter("@CI024", SqlDbType.Int,        4),
                new SqlParameter("@idx",   SqlDbType.Int, 4)
            };
            parameters [0].Value  = model.CI001;
            parameters [1].Value  = model.CI002;
            parameters [2].Value  = model.CI003;
            parameters [3].Value  = model.CI004;
            parameters [4].Value  = model.CI005;
            parameters [5].Value  = model.CI006;
            parameters [6].Value  = model.CI007;
            parameters [7].Value  = model.CI008;
            parameters [8].Value  = model.CI009;
            parameters [9].Value  = model.CI010;
            parameters [10].Value = model.CI011;
            parameters [11].Value = model.CI012;
            parameters [12].Value = model.CI013;
            parameters [13].Value = model.CI014;
            parameters [14].Value = model.CI015;
            parameters [15].Value = model.CI016;
            parameters [16].Value = model.CI017;
            parameters [17].Value = model.CI018;
            parameters [18].Value = model.CI019;
            parameters [19].Value = model.CI020;
            parameters [20].Value = model.CI021;
            parameters [21].Value = model.CI024;
            parameters [22].Value = model.idx;

            SQLString.Add(strSql, parameters);
            //SQLString . Add ( Drity . DrityOfComparation ( "R_482" ,"滚、喷、涂漆生产首件标准样审核确认记录表(R_482)" ,logins ,Drity . GetDt ( ) ,model . CI001 ,strSql . ToString ( ) . Replace ( "'" ,"''" ) ,"编辑" ,"编辑" ) ,null );
        }
Exemplo n.º 5
0
        /// <summary>
        /// edit data from r_pqcb and r_pqcc to database
        /// </summary>
        /// <param name="table"></param>
        /// <param name="_cb"></param>
        /// <param name="logins"></param>
        /// <param name="strList"></param>
        /// <returns></returns>
        public bool Edit(DataTable table, MulaolaoLibrary.StandardAuditForCHEntity _cf, string logins, List <string> strList)
        {
            Hashtable     SQLString = new Hashtable( );
            StringBuilder strSql    = new StringBuilder( );

            edit_pqcf(SQLString, strSql, _cf);
            SQLString.Add(Drity.DrityOfComparation("R_484", "动力段生产首件量.检具审核确认记录表(R_484)", logins, Drity.GetDt( ), _cf.CH001, strSql.ToString( ).Replace("'", "''"), "编辑", "编辑"), null);

            MulaolaoLibrary.StandardAuditForCIEntity _ce = new MulaolaoLibrary.StandardAuditForCIEntity( );
            _ce.CI001 = _cf.CH001;
            for (int i = 0; i < table.Rows.Count; i++)
            {
                _ce.CI002 = table.Rows [i] ["CI002"].ToString( );
                _ce.CI003 = table.Rows [i] ["CI003"].ToString( );
                _ce.CI004 = table.Rows [i] ["CI004"].ToString( );
                if (string.IsNullOrEmpty(table.Rows [i] ["CI005"].ToString( )))
                {
                    _ce.CI005 = null;
                }
                else
                {
                    _ce.CI005 = Convert.ToDateTime(table.Rows [i] ["CI005"]);
                }
                if (string.IsNullOrEmpty(table.Rows [i] ["CI006"].ToString( )))
                {
                    _ce.CI006 = null;
                }
                else
                {
                    _ce.CI006 = Convert.ToDateTime(table.Rows [i] ["CI006"]);
                }
                _ce.CI007 = table.Rows [i] ["CI007"].ToString( );
                _ce.CI008 = table.Rows [i] ["CI008"].ToString( );
                _ce.CI009 = table.Rows [i] ["CI009"].ToString( );
                _ce.CI010 = table.Rows [i] ["CI010"].ToString( );
                _ce.CI011 = table.Rows [i] ["CI011"].ToString( );
                _ce.CI012 = table.Rows [i] ["CI012"].ToString( );
                _ce.CI013 = table.Rows [i] ["CI013"].ToString( );
                if (string.IsNullOrEmpty(table.Rows [i] ["CI014"].ToString( )))
                {
                    _ce.CI014 = null;
                }
                else
                {
                    _ce.CI014 = Convert.ToDateTime(table.Rows [i] ["CI014"]);
                }
                _ce.CI015 = table.Rows [i] ["CI015"].ToString( );
                if (string.IsNullOrEmpty(table.Rows [i] ["CI016"].ToString( )))
                {
                    _ce.CI016 = null;
                }
                else
                {
                    _ce.CI016 = Convert.ToDateTime(table.Rows [i] ["CI016"]);
                }
                _ce.CI017 = table.Rows [i] ["CI017"].ToString( );
                if (string.IsNullOrEmpty(table.Rows [i] ["CI018"].ToString( )))
                {
                    _ce.CI018 = null;
                }
                else
                {
                    _ce.CI018 = Convert.ToDateTime(table.Rows [i] ["CI018"]);
                }
                if (string.IsNullOrEmpty(table.Rows [i] ["CI019"].ToString( )))
                {
                    _ce.CI019 = null;
                }
                else
                {
                    _ce.CI019 = Convert.ToInt32(table.Rows [i] ["CI019"]);
                }
                _ce.CI020 = table.Rows [i] ["CI020"].ToString( );
                _ce.CI021 = table.Rows [i] ["CI021"].ToString( );
                _ce.CI024 = string.IsNullOrEmpty(table.Rows [i] ["CI024"].ToString( )) == true ? 0 : Convert.ToInt32(table.Rows [i] ["CI024"].ToString( ));
                _ce.idx   = string.IsNullOrEmpty(table.Rows [i] ["idx"].ToString( )) == true ? 0 : Convert.ToInt32(table.Rows [i] ["idx"].ToString( ));
                if (_ce.idx < 1)
                {
                    add_pqcg(SQLString, strSql, _ce, logins);
                }
                else
                {
                    edit_pqcg(SQLString, strSql, _ce, logins);
                }
            }

            foreach (string s in strList)
            {
                _ce.idx = Convert.ToInt32(s);
                delete_pqcg(SQLString, strSql, _ce, logins);
            }

            return(SqlHelper.ExecuteSqlTran(SQLString));
        }
Exemplo n.º 6
0
        /// <summary>
        /// save data to r_pqcb and r_pqcc
        /// </summary>
        /// <param name="table"></param>
        /// <param name="_cb"></param>
        /// <returns></returns>
        public bool Save(DataTable table, MulaolaoLibrary.StandardAuditForCHEntity _cf, string logins)
        {
            Hashtable     SQLString = new Hashtable( );
            StringBuilder strSql    = new StringBuilder( );

            _cf.CH001 = getOddNum( );
            add_pqcf(SQLString, strSql, _cf);
            SQLString.Add(Drity.DrityOfComparation("R_487", "包装首件标准样审核确认记录表(R_487)", logins, Drity.GetDt( ), _cf.CH001, strSql.ToString( ).Replace("'", "''"), "新增", "新增"), null);

            MulaolaoLibrary.StandardAuditForCIEntity _ce = new MulaolaoLibrary.StandardAuditForCIEntity( );
            _ce.CI001 = _cf.CH001;
            for (int i = 0; i < table.Rows.Count; i++)
            {
                _ce.CI002 = table.Rows [i] ["CI002"].ToString( );
                _ce.CI003 = table.Rows [i] ["CI003"].ToString( );
                _ce.CI004 = table.Rows [i] ["CI004"].ToString( );
                if (string.IsNullOrEmpty(table.Rows [i] ["CI005"].ToString( )))
                {
                    _ce.CI005 = null;
                }
                else
                {
                    _ce.CI005 = Convert.ToDateTime(table.Rows [i] ["CI005"]);
                }
                if (string.IsNullOrEmpty(table.Rows [i] ["CI006"].ToString( )))
                {
                    _ce.CI006 = null;
                }
                else
                {
                    _ce.CI006 = Convert.ToDateTime(table.Rows [i] ["CI006"]);
                }
                _ce.CI007 = table.Rows [i] ["CI007"].ToString( );
                _ce.CI008 = table.Rows [i] ["CI008"].ToString( );
                _ce.CI009 = table.Rows [i] ["CI009"].ToString( );
                _ce.CI010 = table.Rows [i] ["CI010"].ToString( );
                _ce.CI011 = table.Rows [i] ["CI011"].ToString( );
                _ce.CI012 = table.Rows [i] ["CI012"].ToString( );
                _ce.CI013 = table.Rows [i] ["CI013"].ToString( );
                if (string.IsNullOrEmpty(table.Rows [i] ["CI014"].ToString( )))
                {
                    _ce.CI014 = null;
                }
                else
                {
                    _ce.CI014 = Convert.ToDateTime(table.Rows [i] ["CI014"]);
                }
                _ce.CI015 = table.Rows [i] ["CI015"].ToString( );
                if (string.IsNullOrEmpty(table.Rows [i] ["CI016"].ToString( )))
                {
                    _ce.CI016 = null;
                }
                else
                {
                    _ce.CI016 = Convert.ToDateTime(table.Rows [i] ["CI016"]);
                }
                _ce.CI017 = table.Rows [i] ["CI017"].ToString( );
                if (string.IsNullOrEmpty(table.Rows [i] ["CI018"].ToString( )))
                {
                    _ce.CI018 = null;
                }
                else
                {
                    _ce.CI018 = Convert.ToDateTime(table.Rows [i] ["CI018"]);
                }
                if (string.IsNullOrEmpty(table.Rows [i] ["CI019"].ToString( )))
                {
                    _ce.CI019 = null;
                }
                else
                {
                    _ce.CI019 = Convert.ToInt32(table.Rows [i] ["CI019"]);
                }
                _ce.CI020 = table.Rows [i] ["CI020"].ToString( );
                _ce.CI021 = table.Rows [i] ["CI021"].ToString( );
                _ce.CI024 = string.IsNullOrEmpty(table.Rows [i] ["CI024"].ToString( )) == true ? 0 : Convert.ToInt32(table.Rows [i] ["CI024"].ToString( ));
                add_pqcg(SQLString, strSql, _ce, logins);
            }

            return(SqlHelper.ExecuteSqlTran(SQLString));
        }