void add_pqcc(Hashtable SQLString, StringBuilder strSql, MulaolaoLibrary.StandardAuditTwoCEEntity model, string logins) { strSql = new StringBuilder( ); strSql.Append("insert into R_PQCE("); strSql.Append("CE001,CE002,CE003,CE004,CE005,CE006,CE007,CE008,CE009,CE010,CE011,CE012,CE013,CE014,CE015,CE016,CE017,CE018,CE019,CE020,CE021,CE022,CE023)"); strSql.Append(" values ("); strSql.Append("@CE001,@CE002,@CE003,@CE004,@CE005,@CE006,@CE007,@CE008,@CE009,@CE010,@CE011,@CE012,@CE013,@CE014,@CE015,@CE016,@CE017,@CE018,@CE019,@CE020,@CE021,@CE022,@CE023)"); SqlParameter [] parameters = { new SqlParameter("@CE001", SqlDbType.NVarChar, 20), new SqlParameter("@CE002", SqlDbType.NVarChar, 20), new SqlParameter("@CE003", SqlDbType.NVarChar, 20), new SqlParameter("@CE004", SqlDbType.NVarChar, 20), new SqlParameter("@CE005", SqlDbType.Date, 3), new SqlParameter("@CE006", SqlDbType.Date, 3), new SqlParameter("@CE007", SqlDbType.NVarChar, 20), new SqlParameter("@CE008", SqlDbType.NVarChar, 20), new SqlParameter("@CE009", SqlDbType.NVarChar, 20), new SqlParameter("@CE010", SqlDbType.NVarChar, 20), new SqlParameter("@CE011", SqlDbType.NVarChar, 20), new SqlParameter("@CE012", SqlDbType.NVarChar, 20), new SqlParameter("@CE013", SqlDbType.NVarChar, 20), new SqlParameter("@CE014", SqlDbType.Date, 3), new SqlParameter("@CE015", SqlDbType.NVarChar, 20), new SqlParameter("@CE016", SqlDbType.Date, 3), new SqlParameter("@CE017", SqlDbType.NVarChar, 20), new SqlParameter("@CE018", SqlDbType.Date, 3), new SqlParameter("@CE019", SqlDbType.NVarChar, 20), new SqlParameter("@CE020", SqlDbType.Date, 3), new SqlParameter("@CE021", SqlDbType.NVarChar, 100), new SqlParameter("@CE022", SqlDbType.NVarChar, 20), new SqlParameter("@CE023", SqlDbType.NVarChar, 20) }; parameters [0].Value = model.CE001; parameters [1].Value = model.CE002; parameters [2].Value = model.CE003; parameters [3].Value = model.CE004; parameters [4].Value = model.CE005; parameters [5].Value = model.CE006; parameters [6].Value = model.CE007; parameters [7].Value = model.CE008; parameters [8].Value = model.CE009; parameters [9].Value = model.CE010; parameters [10].Value = model.CE011; parameters [11].Value = model.CE012; parameters [12].Value = model.CE013; parameters [13].Value = model.CE014; parameters [14].Value = model.CE015; parameters [15].Value = model.CE016; parameters [16].Value = model.CE017; parameters [17].Value = model.CE018; parameters [18].Value = model.CE019; parameters [19].Value = model.CE020; parameters [20].Value = model.CE021; parameters [21].Value = model.CE022; parameters [22].Value = model.CE023; SQLString.Add(strSql, parameters); //SQLString . Add ( Drity . DrityOfComparation ( "R_482" ,"滚、喷、涂漆生产首件标准样审核确认记录表(R_482)" ,logins ,Drity . GetDt ( ) ,model . CE001 ,strSql . ToString ( ) . Replace ( "'" ,"''" ) ,"新增" ,"新增" ) ,null ); }
void delete_pqcc(Hashtable SQLString, StringBuilder strSql, MulaolaoLibrary.StandardAuditTwoCEEntity model, string logins) { strSql = new StringBuilder( ); strSql.Append("delete from R_PQCE "); 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 . CE001 ,strSql . ToString ( ) . Replace ( "'" ,"''" ) ,"删除" ,"编辑删除" ) ,null ); }
public FormStandardAuditTwo( ) { InitializeComponent( ); _cd = new MulaolaoLibrary.StandardAuditTwoCDEntity( ); _ce = new MulaolaoLibrary.StandardAuditTwoCEEntity( ); _bll = new MulaolaoBll.Bll.StandardAuditTwoBll( ); tableView = new DataTable( ); tablePrintOne = new DataTable( ); tablePrintTwo = new DataTable( ); GridViewMoHuSelect.SetFilter(secView); GridViewMoHuSelect.SetFilter(bandedGridView1); GrivColumnStyle.setColumnStyle(new DevExpress.XtraGrid.Views.Grid.GridView [] { bandedGridView1 }); MulaolaoBll.UserInfoMation.tableName = this.Name; Power(this); UnEnable( ); secPro.Properties.DataSource = _bll.getProInfo( ); secPro.Properties.DisplayMember = "PQF04"; secPro.Properties.ValueMember = "PQF01"; DataTable dt = _bll.getUser( ); if (dt != null && dt.Rows.Count > 0) { DataTable da = dt.Copy( ).DefaultView.ToTable(true, "CD007"); for (int i = 0; i < da.Rows.Count; i++) { cmbUserOne.Properties.Items.Add(da.Rows [i] ["CD007"].ToString( )); } da = dt.Copy( ).DefaultView.ToTable(true, "CD008"); for (int i = 0; i < da.Rows.Count; i++) { cmbUserTwo.Properties.Items.Add(da.Rows [i] ["CD008"].ToString( )); } da = dt.Copy( ).DefaultView.ToTable(true, "CD009"); for (int i = 0; i < da.Rows.Count; i++) { cmbUserTre.Properties.Items.Add(da.Rows [i] ["CD009"].ToString( )); } da = dt.Copy( ).DefaultView.ToTable(true, "CD010"); for (int i = 0; i < da.Rows.Count; i++) { cmbUserFor.Properties.Items.Add(da.Rows [i] ["CD010"].ToString( )); } } }
/// <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.StandardAuditTwoCDEntity _cd, string logins) { Hashtable SQLString = new Hashtable( ); StringBuilder strSql = new StringBuilder( ); _cd.CD001 = getOddNum( ); add_pqcb(SQLString, strSql, _cd); SQLString.Add(Drity.DrityOfComparation("R_483", "丝、移、热印生产首件标准样审核确认记录表(R_483)", logins, Drity.GetDt( ), _cd.CD001, strSql.ToString( ).Replace("'", "''"), "新增", "新增"), null); MulaolaoLibrary.StandardAuditTwoCEEntity _ce = new MulaolaoLibrary.StandardAuditTwoCEEntity( ); _ce.CE001 = _cd.CD001; for (int i = 0; i < table.Rows.Count; i++) { _ce.CE002 = table.Rows [i] ["CE002"].ToString( ); _ce.CE003 = table.Rows [i] ["CE003"].ToString( ); _ce.CE004 = table.Rows [i] ["CE004"].ToString( ); if (string.IsNullOrEmpty(table.Rows [i] ["CE005"].ToString( ))) { _ce.CE005 = null; } else { _ce.CE005 = Convert.ToDateTime(table.Rows [i] ["CE005"]); } if (string.IsNullOrEmpty(table.Rows [i] ["CE006"].ToString( ))) { _ce.CE006 = null; } else { _ce.CE006 = Convert.ToDateTime(table.Rows [i] ["CE006"]); } _ce.CE007 = table.Rows [i] ["CE007"].ToString( ); _ce.CE008 = table.Rows [i] ["CE008"].ToString( ); _ce.CE009 = table.Rows [i] ["CE009"].ToString( ); _ce.CE010 = table.Rows [i] ["CE010"].ToString( ); _ce.CE011 = table.Rows [i] ["CE011"].ToString( ); _ce.CE012 = table.Rows [i] ["CE012"].ToString( ); _ce.CE013 = table.Rows [i] ["CE013"].ToString( ); if (string.IsNullOrEmpty(table.Rows [i] ["CE014"].ToString( ))) { _ce.CE014 = null; } else { _ce.CE014 = Convert.ToDateTime(table.Rows [i] ["CE014"]); } _ce.CE015 = table.Rows [i] ["CE015"].ToString( ); if (string.IsNullOrEmpty(table.Rows [i] ["CE016"].ToString( ))) { _ce.CE016 = null; } else { _ce.CE016 = Convert.ToDateTime(table.Rows [i] ["CE016"]); } _ce.CE017 = table.Rows [i] ["CE017"].ToString( ); if (string.IsNullOrEmpty(table.Rows [i] ["CE018"].ToString( ))) { _ce.CE018 = null; } else { _ce.CE018 = Convert.ToDateTime(table.Rows [i] ["CE018"]); } _ce.CE019 = table.Rows [i] ["CE019"].ToString( ); if (string.IsNullOrEmpty(table.Rows [i] ["CE020"].ToString( ))) { _ce.CE020 = null; } else { _ce.CE020 = Convert.ToDateTime(table.Rows [i] ["CE020"]); } _ce.CE021 = table.Rows [i] ["CE021"].ToString( ); _ce.CE022 = table.Rows [i] ["CE022"].ToString( ); _ce.CE023 = table.Rows [i] ["CE023"].ToString( ); add_pqcc(SQLString, strSql, _ce, logins); } return(SqlHelper.ExecuteSqlTran(SQLString)); }
void edit_pqcc(Hashtable SQLString, StringBuilder strSql, MulaolaoLibrary.StandardAuditTwoCEEntity model, string logins) { strSql = new StringBuilder( ); strSql.Append("update R_PQCE set "); strSql.Append("CE001=@CE001,"); strSql.Append("CE002=@CE002,"); strSql.Append("CE003=@CE003,"); strSql.Append("CE004=@CE004,"); strSql.Append("CE005=@CE005,"); strSql.Append("CE006=@CE006,"); strSql.Append("CE007=@CE007,"); strSql.Append("CE008=@CE008,"); strSql.Append("CE009=@CE009,"); strSql.Append("CE010=@CE010,"); strSql.Append("CE011=@CE011,"); strSql.Append("CE012=@CE012,"); strSql.Append("CE013=@CE013,"); strSql.Append("CE014=@CE014,"); strSql.Append("CE015=@CE015,"); strSql.Append("CE016=@CE016,"); strSql.Append("CE017=@CE017,"); strSql.Append("CE018=@CE018,"); strSql.Append("CE019=@CE019,"); strSql.Append("CE020=@CE020,"); strSql.Append("CE021=@CE021,"); strSql.Append("CE022=@CE022,"); strSql.Append("CE023=@CE023 "); strSql.Append(" where idx=@idx"); SqlParameter [] parameters = { new SqlParameter("@CE001", SqlDbType.NVarChar, 20), new SqlParameter("@CE002", SqlDbType.NVarChar, 20), new SqlParameter("@CE003", SqlDbType.NVarChar, 20), new SqlParameter("@CE004", SqlDbType.NVarChar, 20), new SqlParameter("@CE005", SqlDbType.Date, 3), new SqlParameter("@CE006", SqlDbType.Date, 3), new SqlParameter("@CE007", SqlDbType.NVarChar, 20), new SqlParameter("@CE008", SqlDbType.NVarChar, 20), new SqlParameter("@CE009", SqlDbType.NVarChar, 20), new SqlParameter("@CE010", SqlDbType.NVarChar, 20), new SqlParameter("@CE011", SqlDbType.NVarChar, 20), new SqlParameter("@CE012", SqlDbType.NVarChar, 20), new SqlParameter("@CE013", SqlDbType.NVarChar, 20), new SqlParameter("@CE014", SqlDbType.Date, 3), new SqlParameter("@CE015", SqlDbType.NVarChar, 20), new SqlParameter("@CE016", SqlDbType.Date, 3), new SqlParameter("@CE017", SqlDbType.NVarChar, 20), new SqlParameter("@CE018", SqlDbType.Date, 3), new SqlParameter("@CE019", SqlDbType.NVarChar, 20), new SqlParameter("@CE020", SqlDbType.Date, 3), new SqlParameter("@CE021", SqlDbType.NVarChar, 100), new SqlParameter("@CE022", SqlDbType.NVarChar, 20), new SqlParameter("@CE023", SqlDbType.NVarChar, 20), new SqlParameter("@idx", SqlDbType.Int, 4) }; parameters [0].Value = model.CE001; parameters [1].Value = model.CE002; parameters [2].Value = model.CE003; parameters [3].Value = model.CE004; parameters [4].Value = model.CE005; parameters [5].Value = model.CE006; parameters [6].Value = model.CE007; parameters [7].Value = model.CE008; parameters [8].Value = model.CE009; parameters [9].Value = model.CE010; parameters [10].Value = model.CE011; parameters [11].Value = model.CE012; parameters [12].Value = model.CE013; parameters [13].Value = model.CE014; parameters [14].Value = model.CE015; parameters [15].Value = model.CE016; parameters [16].Value = model.CE017; parameters [17].Value = model.CE018; parameters [18].Value = model.CE019; parameters [19].Value = model.CE020; parameters [20].Value = model.CE021; parameters [21].Value = model.CE022; parameters [22].Value = model.CE023; parameters [23].Value = model.idx; SQLString.Add(strSql, parameters); //SQLString . Add ( Drity . DrityOfComparation ( "R_482" ,"滚、喷、涂漆生产首件标准样审核确认记录表(R_482)" ,logins ,Drity . GetDt ( ) ,model . CE001 ,strSql . ToString ( ) . Replace ( "'" ,"''" ) ,"编辑" ,"编辑" ) ,null ); }