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; }
void add_cv(Hashtable SQLString, StringBuilder strSql, MulaolaoLibrary.TestResultRecordOneCVEntity model) { strSql = new StringBuilder( ); strSql.Append("insert into R_PQCV("); strSql.Append("CV001,CV002,CV003,CV004,CV005,CV006,CV007,CV008,CV009,CV010)"); strSql.Append(" values ("); strSql.Append("@CV001,@CV002,@CV003,@CV004,@CV005,@CV006,@CV007,@CV008,@CV009,@CV010)"); SqlParameter [] parameters = { new SqlParameter("@CV001", SqlDbType.NVarChar, 20), new SqlParameter("@CV002", SqlDbType.NVarChar, 20), new SqlParameter("@CV003", SqlDbType.NVarChar, 20), new SqlParameter("@CV004", SqlDbType.NVarChar, 20), new SqlParameter("@CV005", SqlDbType.NVarChar, 20), new SqlParameter("@CV006", SqlDbType.NVarChar, 20), new SqlParameter("@CV007", SqlDbType.NVarChar, 20), new SqlParameter("@CV008", SqlDbType.NVarChar, 20), new SqlParameter("@CV009", SqlDbType.NVarChar, 20), new SqlParameter("@CV010", SqlDbType.NVarChar, 20) }; parameters [0].Value = model.CV001; parameters [1].Value = model.CV002; parameters [2].Value = model.CV003; parameters [3].Value = model.CV004; parameters [4].Value = model.CV005; parameters [5].Value = model.CV006; parameters [6].Value = model.CV007; parameters [7].Value = model.CV008; parameters [8].Value = model.CV009; parameters [9].Value = model.CV010; SQLString.Add(strSql, parameters); }
void setValue( ) { tableView = _bll.getTableView(" CU001='" + _cu.CU001 + "'"); gridControl1.DataSource = tableView; tableOneView = _bll.getTableViewOne( ); gridControl2.DataSource = tableOneView; _cv = _bll.getModel(_cv.CV001); setValueHead( ); }
public MulaolaoLibrary.TestResultRecordOneCVEntity getModel(DataRow row) { MulaolaoLibrary.TestResultRecordOneCVEntity model = new MulaolaoLibrary.TestResultRecordOneCVEntity( ); if (row != null) { if (row ["idx"] != null && row ["idx"].ToString( ) != "") { model.idx = int.Parse(row ["idx"].ToString( )); } if (row ["CV001"] != null) { model.CV001 = row ["CV001"].ToString( ); } if (row ["CV002"] != null) { model.CV002 = row ["CV002"].ToString( ); } if (row ["CV003"] != null) { model.CV003 = row ["CV003"].ToString( ); } if (row ["CV004"] != null) { model.CV004 = row ["CV004"].ToString( ); } if (row ["CV005"] != null) { model.CV005 = row ["CV005"].ToString( ); } if (row ["CV006"] != null) { model.CV006 = row ["CV006"].ToString( ); } if (row ["CV007"] != null) { model.CV007 = row ["CV007"].ToString( ); } if (row ["CV008"] != null) { model.CV008 = row ["CV008"].ToString( ); } if (row ["CV009"] != null) { model.CV009 = row ["CV009"].ToString( ); } if (row ["CV010"] != null) { model.CV010 = row ["CV010"].ToString( ); } } return(model); }
void edit_cv(Hashtable SQLString, StringBuilder strSql, MulaolaoLibrary.TestResultRecordOneCVEntity model) { strSql = new StringBuilder( ); strSql.Append("update R_PQCV set "); strSql.Append("CV001=@CV001,"); strSql.Append("CV002=@CV002,"); strSql.Append("CV003=@CV003,"); strSql.Append("CV004=@CV004,"); strSql.Append("CV005=@CV005,"); strSql.Append("CV006=@CV006,"); strSql.Append("CV007=@CV007,"); strSql.Append("CV008=@CV008,"); strSql.Append("CV009=@CV009,"); strSql.Append("CV010=@CV010 "); strSql.Append(" where idx=@idx"); SqlParameter [] parameters = { new SqlParameter("@CV001", SqlDbType.NVarChar, 20), new SqlParameter("@CV002", SqlDbType.NVarChar, 20), new SqlParameter("@CV003", SqlDbType.NVarChar, 20), new SqlParameter("@CV004", SqlDbType.NVarChar, 20), new SqlParameter("@CV005", SqlDbType.NVarChar, 20), new SqlParameter("@CV006", SqlDbType.NVarChar, 20), new SqlParameter("@CV007", SqlDbType.NVarChar, 20), new SqlParameter("@CV008", SqlDbType.NVarChar, 20), new SqlParameter("@CV009", SqlDbType.NVarChar, 20), new SqlParameter("@CV010", SqlDbType.NVarChar, 20), new SqlParameter("@idx", SqlDbType.Int, 4) }; parameters [0].Value = model.CV001; parameters [1].Value = model.CV002; parameters [2].Value = model.CV003; parameters [3].Value = model.CV004; parameters [4].Value = model.CV005; parameters [5].Value = model.CV006; parameters [6].Value = model.CV007; parameters [7].Value = model.CV008; parameters [8].Value = model.CV009; parameters [9].Value = model.CV010; parameters [10].Value = model.idx; SQLString.Add(strSql, parameters); }
/// <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)); }
/// <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) { return(_dal.Save(tableOnt, tableTwo, _cv, bodyList, coeList, logins)); }