Ejemplo n.º 1
0
        public FormTestResultRecordOne( )
        {
            InitializeComponent( );

            _cu          = new MulaolaoLibrary.TestResultRecordOneCUEntity( );
            _cv          = new MulaolaoLibrary.TestResultRecordOneCVEntity( );
            _cw          = new MulaolaoLibrary.TestResultRecordOneCWEntity( );
            _bll         = new MulaolaoBll.Bll.TestResultRecordOneBll( );
            tableView    = new DataTable( );
            tableOneView = new DataTable( );
            MulaolaoBll.UserInfoMation.tableName = this.Name;

            GridViewMoHuSelect.SetFilter(secView);
            GridViewMoHuSelect.SetFilter(gridView1);
            GridViewMoHuSelect.SetFilter(gridView2);
            GrivColumnStyle.setColumnStyle(new DevExpress.XtraGrid.Views.Grid.GridView [] { gridView1, gridView2 });

            Power(this);
            UnEnable( );

            secCV002.Properties.DataSource    = _bll.getProInfo( );
            secCV002.Properties.DisplayMember = "PQF04";
            secCV002.Properties.ValueMember   = "PQF01";

            reCheckBox.DataSource    = _bll.getProNum( );
            reCheckBox.DisplayMember = "CW001";

            tableOneView            = _bll.getTableViewOne( );
            gridControl2.DataSource = tableOneView;
        }
Ejemplo n.º 2
0
        void delete_cw(Hashtable SQLString, StringBuilder strSql, MulaolaoLibrary.TestResultRecordOneCWEntity model)
        {
            strSql = new StringBuilder( );
            strSql.Append("delete from R_PQCW ");
            strSql.Append(" where idx=@idx");
            SqlParameter [] parameters =
            {
                new SqlParameter("@idx", SqlDbType.Int, 4)
            };
            parameters [0].Value = model.idx;

            SQLString.Add(SQLString, parameters);
        }
Ejemplo n.º 3
0
        void add_cw(Hashtable SQLString, StringBuilder strSql, MulaolaoLibrary.TestResultRecordOneCWEntity model)
        {
            strSql = new StringBuilder( );
            strSql.Append("insert into R_PQCW(");
            strSql.Append("CW001,CW002)");
            strSql.Append(" values (");
            strSql.Append("@CW001,@CW002)");

            SqlParameter [] parameters =
            {
                new SqlParameter("@CW001", SqlDbType.NVarChar, 20),
                new SqlParameter("@CW002", SqlDbType.NVarChar, 50)
            };
            parameters [0].Value = model.CW001;
            parameters [1].Value = model.CW002;

            SQLString.Add(strSql, parameters);
        }
Ejemplo n.º 4
0
        void edit_cw(Hashtable SQLString, StringBuilder strSql, MulaolaoLibrary.TestResultRecordOneCWEntity model)
        {
            strSql = new StringBuilder( );
            strSql.Append("update R_PQCW set ");
            strSql.Append("CW001=@CW001,");
            strSql.Append("CW002=@CW002 ");
            strSql.Append(" where idx=@idx");
            SqlParameter [] parameters =
            {
                new SqlParameter("@CW001", SqlDbType.NVarChar, 20),
                new SqlParameter("@CW002", SqlDbType.NVarChar, 50),
                new SqlParameter("@idx",   SqlDbType.Int, 4)
            };
            parameters [0].Value = model.CW001;
            parameters [1].Value = model.CW002;
            parameters [2].Value = model.idx;

            SQLString.Add(strSql, parameters);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// save data to r_pqcv r_pqcu r_pqcw
        /// </summary>
        /// <param name="tableOnt"></param>
        /// <param name="tableTwo"></param>
        /// <param name="_cv"></param>
        /// <param name="bodyList"></param>
        /// <param name="coeList"></param>
        /// <param name="logins"></param>
        /// <returns></returns>
        public bool Save(DataTable tableOnt, DataTable tableTwo, MulaolaoLibrary.TestResultRecordOneCVEntity _cv, List <string> bodyList, List <string> coeList, string logins)
        {
            Hashtable     SQLString = new Hashtable( );
            StringBuilder strSql    = new StringBuilder( );

            if (_cv.idx < 1)
            {
                _cv.CV001 = getOddNum( );
                add_cv(SQLString, strSql, _cv);
                SQLString.Add(Drity.DrityOfComparation("R_368", "粘接(R_368)", logins, Drity.GetDt( ), _cv.CV001, strSql.ToString( ).Replace("'", "''"), "新增", "新增表头"), null);
            }
            else
            {
                edit_cv(SQLString, strSql, _cv);
                SQLString.Add(Drity.DrityOfComparation("R_368", "粘接(R_368)", logins, Drity.GetDt( ), _cv.CV001, strSql.ToString( ).Replace("'", "''"), "编辑", "编辑表头"), null);
            }

            MulaolaoLibrary.TestResultRecordOneCUEntity model = new MulaolaoLibrary.TestResultRecordOneCUEntity( );
            model.CU001 = _cv.CV001;
            for (int i = 0; i < tableOnt.Rows.Count; i++)
            {
                model.CU002 = tableOnt.Rows [i] ["CU002"].ToString( );
                model.CU003 = tableOnt.Rows [i] ["CU003"].ToString( );
                model.CU004 = tableOnt.Rows [i] ["CU004"].ToString( );
                if (string.IsNullOrEmpty(tableOnt.Rows [i] ["CU005"].ToString( )))
                {
                    model.CU005 = null;
                }
                else
                {
                    model.CU005 = Convert.ToDateTime(tableOnt.Rows [i] ["CU005"].ToString( ));
                }
                if (string.IsNullOrEmpty(tableOnt.Rows [i] ["CU006"].ToString( )))
                {
                    model.CU006 = null;
                }
                else
                {
                    model.CU006 = Convert.ToDateTime(tableOnt.Rows [i] ["CU006"].ToString( ));
                }
                model.CU007 = tableOnt.Rows [i] ["CU007"].ToString( );
                model.CU008 = tableOnt.Rows [i] ["CU008"].ToString( );
                if (string.IsNullOrEmpty(tableOnt.Rows [i] ["CU009"].ToString( )))
                {
                    model.CU009 = null;
                }
                else
                {
                    model.CU009 = Convert.ToDateTime(tableOnt.Rows [i] ["CU009"].ToString( ));
                }
                model.CU010 = tableOnt.Rows [i] ["CU010"].ToString( );
                model.CU028 = tableOnt.Rows [i] ["CU028"].ToString( );
                if (string.IsNullOrEmpty(tableOnt.Rows [i] ["CU011"].ToString( )))
                {
                    model.CU011 = null;
                }
                else
                {
                    model.CU011 = Convert.ToDateTime(tableOnt.Rows [i] ["CU011"].ToString( ));
                }
                model.CU012 = tableOnt.Rows [i] ["CU012"].ToString( );
                model.CU013 = tableOnt.Rows [i] ["CU013"].ToString( );
                if (string.IsNullOrEmpty(tableOnt.Rows [i] ["CU014"].ToString( )))
                {
                    model.CU014 = null;
                }
                else
                {
                    model.CU014 = Convert.ToDateTime(tableOnt.Rows [i] ["CU014"].ToString( ));
                }
                model.CU015 = tableOnt.Rows [i] ["CU015"].ToString( );
                model.CU016 = tableOnt.Rows [i] ["CU016"].ToString( );
                if (string.IsNullOrEmpty(tableOnt.Rows [i] ["CU017"].ToString( )))
                {
                    model.CU017 = null;
                }
                else
                {
                    model.CU017 = Convert.ToDateTime(tableOnt.Rows [i] ["CU017"].ToString( ));
                }
                model.CU018 = tableOnt.Rows [i] ["CU018"].ToString( );
                model.CU019 = tableOnt.Rows [i] ["CU019"].ToString( );
                if (string.IsNullOrEmpty(tableOnt.Rows [i] ["CU020"].ToString( )))
                {
                    model.CU020 = null;
                }
                else
                {
                    model.CU020 = Convert.ToDateTime(tableOnt.Rows [i] ["CU020"].ToString( ));
                }
                model.CU021 = tableOnt.Rows [i] ["CU021"].ToString( );
                model.CU022 = tableOnt.Rows [i] ["CU022"].ToString( );
                if (string.IsNullOrEmpty(tableOnt.Rows [i] ["CU023"].ToString( )))
                {
                    model.CU023 = null;
                }
                else
                {
                    model.CU023 = Convert.ToDateTime(tableOnt.Rows [i] ["CU023"].ToString( ));
                }
                model.CU024 = tableOnt.Rows [i] ["CU024"].ToString( );
                model.CU025 = tableOnt.Rows [i] ["CU025"].ToString( );
                model.CU026 = tableOnt.Rows [i] ["CU026"].ToString( );
                model.CU027 = tableOnt.Rows [i] ["CU027"].ToString( );
                model.idx   = string.IsNullOrEmpty(tableOnt.Rows [i] ["idx"].ToString( )) == true ? 0 : Convert.ToInt32(tableOnt.Rows [i] ["idx"].ToString( ));
                if (model.idx < 1)
                {
                    add_cu(SQLString, strSql, model);
                    SQLString.Add(Drity.DrityOfComparation("R_368-" + i, "粘接(R_368)", logins, Drity.GetDt( ), model.CU001, strSql.ToString( ).Replace("'", "''"), "新增", "新增单身"), null);
                }
                else
                {
                    edit_cu(SQLString, strSql, model);
                    SQLString.Add(Drity.DrityOfComparation("R_368-" + i, "粘接(R_368)", logins, Drity.GetDt( ), model.CU001, strSql.ToString( ).Replace("'", "''"), "编辑", "编辑单身"), null);
                }
            }

            if (bodyList.Count > 0)
            {
                foreach (string s in bodyList)
                {
                    model.idx = Convert.ToInt32(s);
                    delete_cu(SQLString, strSql, model);
                    SQLString.Add(Drity.DrityOfComparation("R_368-" + model.idx, "粘接(R_368)", logins, Drity.GetDt( ), model.CU001, strSql.ToString( ).Replace("'", "''"), "删除", "删除单身"), null);
                }
            }

            MulaolaoLibrary.TestResultRecordOneCWEntity _cw = new MulaolaoLibrary.TestResultRecordOneCWEntity( );
            for (int i = 0; i < tableTwo.Rows.Count; i++)
            {
                _cw.idx   = string.IsNullOrEmpty(tableTwo.Rows [i] ["idx"].ToString( )) == true ? 0 : Convert.ToInt32(tableTwo.Rows [i] ["idx"].ToString( ));
                _cw.CW001 = tableTwo.Rows [i] ["CW001"].ToString( );
                _cw.CW002 = tableTwo.Rows [i] ["CW002"].ToString( );

                if (_cw.idx > 0)
                {
                    edit_cw(SQLString, strSql, _cw);
                    SQLString.Add(Drity.DrityOfComparation("R_368-" + i, "粘接(R_368)", logins, Drity.GetDt( ), model.CU001, strSql.ToString( ).Replace("'", "''"), "编辑", "编辑系数"), null);
                }
                else
                {
                    add_cw(SQLString, strSql, _cw);
                    SQLString.Add(Drity.DrityOfComparation("R_368-" + i, "粘接(R_368)", logins, Drity.GetDt( ), model.CU001, strSql.ToString( ).Replace("'", "''"), "新增", "新增系数"), null);
                }
            }

            if (coeList.Count > 0)
            {
                foreach (string s in coeList)
                {
                    _cw.idx = Convert.ToInt32(s);
                    delete_cw(SQLString, strSql, _cw);
                    SQLString.Add(Drity.DrityOfComparation("R_368-" + _cw.idx, "粘接(R_368)", logins, Drity.GetDt( ), model.CU001, strSql.ToString( ).Replace("'", "''"), "删除", "删除系数"), null);
                }
            }

            return(SqlHelper.ExecuteSqlTran(SQLString));
        }