public FormQualityReport( ) { InitializeComponent( ); model = new MulaolaoLibrary.QualityReportDKEntity( ); _bll = new MulaolaoBll.Bll.QualityReportBll( ); GridViewMoHuSelect.SetFilter(secView); MulaolaoBll.UserInfoMation.tableName = this.Name; UnEnable( ); Power(this); secDK003.Properties.DataSource = _bll.getTableOfPro( ); secDK003.Properties.DisplayMember = "PQF04"; secDK003.Properties.ValueMember = "PQF01"; DataTable bd = _bll.getTableOfPersonBD( ); cmbDK020.DataSource = bd.Copy( ); cmbDK020.DisplayMember = "DBA002"; cmbDK021.DataSource = bd.Copy( ); cmbDK021.DisplayMember = "DBA002"; cmbDK022.DataSource = bd.Copy( ); cmbDK022.DisplayMember = "DBA002"; DataTable pd = _bll.getTableOfPersonBDUser( ); cmbDK016.DataSource = pd.DefaultView.ToTable(true, "DK016"); cmbDK016.DisplayMember = "DK016"; cmbDK018.DataSource = pd.DefaultView.ToTable(true, "DK018"); cmbDK018.DisplayMember = "DK018"; cmbDK023.DataSource = pd.DefaultView.ToTable(true, "DK023"); cmbDK023.DisplayMember = "DK023"; cmbDK024.DataSource = pd.DefaultView.ToTable(true, "DK024"); cmbDK024.DisplayMember = "DK024"; cmbDK025.DataSource = pd.DefaultView.ToTable(true, "DK025"); cmbDK025.DisplayMember = "DK025"; cmbDK029.DataSource = pd.DefaultView.ToTable(true, "DK029"); cmbDK029.DisplayMember = "DK029"; cmbDK030.DataSource = pd.DefaultView.ToTable(true, "DK030"); cmbDK030.DisplayMember = "DK030"; cmbDK031.DataSource = pd.DefaultView.ToTable(true, "DK031"); cmbDK031.DisplayMember = "DK031"; cmbDK033.DataSource = pd.DefaultView.ToTable(true, "DK033"); cmbDK033.DisplayMember = "DK033"; cmbDK034.DataSource = pd.DefaultView.ToTable(true, "DK034"); cmbDK034.DisplayMember = "DK034"; cmbDK036.DataSource = pd.DefaultView.ToTable(true, "DK036"); cmbDK036.DisplayMember = "DK036"; DataTable pw = _bll.getTableOfPersonPW( ); cmbDK026.DataSource = pw.Copy( ); cmbDK026.DisplayMember = "DBA002"; cmbDK027.DataSource = pw.Copy( ); cmbDK027.DisplayMember = "DBA002"; cmbDK028.DataSource = pw.Copy( ); cmbDK028.DisplayMember = "DBA002"; }
/// <summary> /// add data to r_pqdk /// </summary> /// <param name="model"></param> /// <param name="logins"></param> /// <returns></returns> public bool Save(MulaolaoLibrary.QualityReportDKEntity model, string logins, string state) { Hashtable SQLString = new Hashtable( ); StringBuilder strSql = new StringBuilder( ); if (state.Equals("edit")) { edit_dk(SQLString, strSql, model); SQLString.Add(Drity.DrityOfComparation("R_293", "客检产品质量报告(R_293)", logins, Drity.GetDt( ), model.DK001, strSql.ToString( ).Replace("'", "''"), "编辑", "编辑表头"), null); } else { model.DK001 = getOddNum( ); add_dk(SQLString, strSql, model); SQLString.Add(Drity.DrityOfComparation("R_293", "客检产品质量报告(R_293)", logins, Drity.GetDt( ), model.DK001, strSql.ToString( ).Replace("'", "''"), "新增", "新增表头"), null); } return(SqlHelper.ExecuteSqlTran(SQLString)); }
void edit_dk(Hashtable SQLString, StringBuilder strSql, MulaolaoLibrary.QualityReportDKEntity model) { strSql = new StringBuilder( ); strSql.Append("update R_PQDK set "); strSql.Append("DK002=@DK002,"); strSql.Append("DK003=@DK003,"); strSql.Append("DK004=@DK004,"); strSql.Append("DK005=@DK005,"); strSql.Append("DK006=@DK006,"); strSql.Append("DK007=@DK007,"); strSql.Append("DK008=@DK008,"); strSql.Append("DK009=@DK009,"); strSql.Append("DK010=@DK010,"); strSql.Append("DK011=@DK011,"); strSql.Append("DK012=@DK012,"); strSql.Append("DK013=@DK013,"); strSql.Append("DK014=@DK014,"); strSql.Append("DK015=@DK015,"); strSql.Append("DK016=@DK016,"); strSql.Append("DK017=@DK017,"); strSql.Append("DK018=@DK018,"); strSql.Append("DK019=@DK019,"); strSql.Append("DK020=@DK020,"); strSql.Append("DK021=@DK021,"); strSql.Append("DK022=@DK022,"); strSql.Append("DK023=@DK023,"); strSql.Append("DK024=@DK024,"); strSql.Append("DK025=@DK025,"); strSql.Append("DK026=@DK026,"); strSql.Append("DK027=@DK027,"); strSql.Append("DK028=@DK028,"); strSql.Append("DK029=@DK029,"); strSql.Append("DK030=@DK030,"); strSql.Append("DK031=@DK031,"); strSql.Append("DK032=@DK032,"); strSql.Append("DK033=@DK033,"); strSql.Append("DK034=@DK034,"); strSql.Append("DK035=@DK035,"); strSql.Append("DK036=@DK036,"); strSql.Append("DK037=@DK037,"); strSql.Append("DK038=@DK038,"); strSql.Append("DK039=@DK039 "); strSql.Append(" where DK001=@DK001 "); SqlParameter [] parameters = { new SqlParameter("@DK001", SqlDbType.NVarChar, 20), new SqlParameter("@DK002", SqlDbType.NVarChar, 20), new SqlParameter("@DK003", SqlDbType.NVarChar, 50), new SqlParameter("@DK004", SqlDbType.NVarChar, 20), new SqlParameter("@DK005", SqlDbType.NVarChar, 20), new SqlParameter("@DK006", SqlDbType.NVarChar, 20), new SqlParameter("@DK007", SqlDbType.NVarChar, 20), new SqlParameter("@DK008", SqlDbType.NVarChar, 20), new SqlParameter("@DK009", SqlDbType.Date, 3), new SqlParameter("@DK010", SqlDbType.Int, 4), new SqlParameter("@DK011", SqlDbType.Int, 4), new SqlParameter("@DK012", SqlDbType.Date, 3), new SqlParameter("@DK013", SqlDbType.Date, 3), new SqlParameter("@DK014", SqlDbType.Date, 3), new SqlParameter("@DK015", SqlDbType.Date, 3), new SqlParameter("@DK016", SqlDbType.NVarChar, 20), new SqlParameter("@DK017", SqlDbType.Date, 3), new SqlParameter("@DK018", SqlDbType.NVarChar, 20), new SqlParameter("@DK019", SqlDbType.Int, 4), new SqlParameter("@DK020", SqlDbType.NVarChar, 20), new SqlParameter("@DK021", SqlDbType.NVarChar, 20), new SqlParameter("@DK022", SqlDbType.NVarChar, 20), new SqlParameter("@DK023", SqlDbType.NVarChar, 20), new SqlParameter("@DK024", SqlDbType.NVarChar, 20), new SqlParameter("@DK025", SqlDbType.NVarChar, 20), new SqlParameter("@DK026", SqlDbType.NVarChar, 20), new SqlParameter("@DK027", SqlDbType.NVarChar, 20), new SqlParameter("@DK028", SqlDbType.NVarChar, 20), new SqlParameter("@DK029", SqlDbType.NVarChar, 20), new SqlParameter("@DK030", SqlDbType.NVarChar, 20), new SqlParameter("@DK031", SqlDbType.NVarChar, 20), new SqlParameter("@DK032", SqlDbType.NVarChar, 100), new SqlParameter("@DK033", SqlDbType.NVarChar, 20), new SqlParameter("@DK034", SqlDbType.NVarChar, 20), new SqlParameter("@DK035", SqlDbType.NVarChar, 100), new SqlParameter("@DK036", SqlDbType.NVarChar, 20), new SqlParameter("@DK037", SqlDbType.NVarChar, 100), new SqlParameter("@DK038", SqlDbType.NVarChar, 100), new SqlParameter("@DK039", SqlDbType.NVarChar, 100) }; parameters [0].Value = model.DK001; parameters [1].Value = model.DK002; parameters [2].Value = model.DK003; parameters [3].Value = model.DK004; parameters [4].Value = model.DK005; parameters [5].Value = model.DK006; parameters [6].Value = model.DK007; parameters [7].Value = model.DK008; parameters [8].Value = model.DK009; parameters [9].Value = model.DK010; parameters [10].Value = model.DK011; parameters [11].Value = model.DK012; parameters [12].Value = model.DK013; parameters [13].Value = model.DK014; parameters [14].Value = model.DK015; parameters [15].Value = model.DK016; parameters [16].Value = model.DK017; parameters [17].Value = model.DK018; parameters [18].Value = model.DK019; parameters [19].Value = model.DK020; parameters [20].Value = model.DK021; parameters [21].Value = model.DK022; parameters [22].Value = model.DK023; parameters [23].Value = model.DK024; parameters [24].Value = model.DK025; parameters [25].Value = model.DK026; parameters [26].Value = model.DK027; parameters [27].Value = model.DK028; parameters [28].Value = model.DK029; parameters [29].Value = model.DK030; parameters [30].Value = model.DK031; parameters [31].Value = model.DK032; parameters [32].Value = model.DK033; parameters [33].Value = model.DK034; parameters [34].Value = model.DK035; parameters [35].Value = model.DK036; parameters [36].Value = model.DK037; parameters [37].Value = model.DK038; parameters [38].Value = model.DK039; SQLString.Add(strSql, parameters); }
void add_dk(Hashtable SQLString, StringBuilder strSql, MulaolaoLibrary.QualityReportDKEntity model) { strSql = new StringBuilder( ); strSql.Append("insert into R_PQDK("); strSql.Append("DK001,DK002,DK003,DK004,DK005,DK006,DK007,DK008,DK009,DK010,DK011,DK012,DK013,DK014,DK015,DK016,DK017,DK018,DK019,DK020,DK021,DK022,DK023,DK024,DK025,DK026,DK027,DK028,DK029,DK030,DK031,DK032,DK033,DK034,DK035,DK036,DK037,DK038,DK039)"); strSql.Append(" values ("); strSql.Append("@DK001,@DK002,@DK003,@DK004,@DK005,@DK006,@DK007,@DK008,@DK009,@DK010,@DK011,@DK012,@DK013,@DK014,@DK015,@DK016,@DK017,@DK018,@DK019,@DK020,@DK021,@DK022,@DK023,@DK024,@DK025,@DK026,@DK027,@DK028,@DK029,@DK030,@DK031,@DK032,@DK033,@DK034,@DK035,@DK036,@DK037,@DK038,@DK039)"); SqlParameter [] parameters = { new SqlParameter("@DK001", SqlDbType.NVarChar, 20), new SqlParameter("@DK002", SqlDbType.NVarChar, 20), new SqlParameter("@DK003", SqlDbType.NVarChar, 50), new SqlParameter("@DK004", SqlDbType.NVarChar, 20), new SqlParameter("@DK005", SqlDbType.NVarChar, 20), new SqlParameter("@DK006", SqlDbType.NVarChar, 20), new SqlParameter("@DK007", SqlDbType.NVarChar, 20), new SqlParameter("@DK008", SqlDbType.NVarChar, 20), new SqlParameter("@DK009", SqlDbType.Date, 3), new SqlParameter("@DK010", SqlDbType.Int, 4), new SqlParameter("@DK011", SqlDbType.Int, 4), new SqlParameter("@DK012", SqlDbType.Date, 3), new SqlParameter("@DK013", SqlDbType.Date, 3), new SqlParameter("@DK014", SqlDbType.Date, 3), new SqlParameter("@DK015", SqlDbType.Date, 3), new SqlParameter("@DK016", SqlDbType.NVarChar, 20), new SqlParameter("@DK017", SqlDbType.Date, 3), new SqlParameter("@DK018", SqlDbType.NVarChar, 20), new SqlParameter("@DK019", SqlDbType.Int, 4), new SqlParameter("@DK020", SqlDbType.NVarChar, 20), new SqlParameter("@DK021", SqlDbType.NVarChar, 20), new SqlParameter("@DK022", SqlDbType.NVarChar, 20), new SqlParameter("@DK023", SqlDbType.NVarChar, 20), new SqlParameter("@DK024", SqlDbType.NVarChar, 20), new SqlParameter("@DK025", SqlDbType.NVarChar, 20), new SqlParameter("@DK026", SqlDbType.NVarChar, 20), new SqlParameter("@DK027", SqlDbType.NVarChar, 20), new SqlParameter("@DK028", SqlDbType.NVarChar, 20), new SqlParameter("@DK029", SqlDbType.NVarChar, 20), new SqlParameter("@DK030", SqlDbType.NVarChar, 20), new SqlParameter("@DK031", SqlDbType.NVarChar, 20), new SqlParameter("@DK032", SqlDbType.NVarChar, 100), new SqlParameter("@DK033", SqlDbType.NVarChar, 20), new SqlParameter("@DK034", SqlDbType.NVarChar, 20), new SqlParameter("@DK035", SqlDbType.NVarChar, 100), new SqlParameter("@DK036", SqlDbType.NVarChar, 20), new SqlParameter("@DK037", SqlDbType.NVarChar, 100), new SqlParameter("@DK038", SqlDbType.NVarChar, 100), new SqlParameter("@DK039", SqlDbType.NVarChar, 100) }; parameters [0].Value = model.DK001; parameters [1].Value = model.DK002; parameters [2].Value = model.DK003; parameters [3].Value = model.DK004; parameters [4].Value = model.DK005; parameters [5].Value = model.DK006; parameters [6].Value = model.DK007; parameters [7].Value = model.DK008; parameters [8].Value = model.DK009; parameters [9].Value = model.DK010; parameters [10].Value = model.DK011; parameters [11].Value = model.DK012; parameters [12].Value = model.DK013; parameters [13].Value = model.DK014; parameters [14].Value = model.DK015; parameters [15].Value = model.DK016; parameters [16].Value = model.DK017; parameters [17].Value = model.DK018; parameters [18].Value = model.DK019; parameters [19].Value = model.DK020; parameters [20].Value = model.DK021; parameters [21].Value = model.DK022; parameters [22].Value = model.DK023; parameters [23].Value = model.DK024; parameters [24].Value = model.DK025; parameters [25].Value = model.DK026; parameters [26].Value = model.DK027; parameters [27].Value = model.DK028; parameters [28].Value = model.DK029; parameters [29].Value = model.DK030; parameters [30].Value = model.DK031; parameters [31].Value = model.DK032; parameters [32].Value = model.DK033; parameters [33].Value = model.DK034; parameters [34].Value = model.DK035; parameters [35].Value = model.DK036; parameters [36].Value = model.DK037; parameters [37].Value = model.DK038; parameters [38].Value = model.DK039; SQLString.Add(strSql, parameters); }
public MulaolaoLibrary.QualityReportDKEntity getModel(DataRow row) { MulaolaoLibrary.QualityReportDKEntity model = new MulaolaoLibrary.QualityReportDKEntity( ); if (row != null) { if (row ["idx"] != null && row ["idx"].ToString( ) != "") { model.idx = int.Parse(row ["idx"].ToString( )); } if (row ["DK001"] != null) { model.DK001 = row ["DK001"].ToString( ); } if (row ["DK002"] != null) { model.DK002 = row ["DK002"].ToString( ); } if (row ["DK003"] != null) { model.DK003 = row ["DK003"].ToString( ); } if (row ["DK004"] != null) { model.DK004 = row ["DK004"].ToString( ); } if (row ["DK005"] != null) { model.DK005 = row ["DK005"].ToString( ); } if (row ["DK006"] != null) { model.DK006 = row ["DK006"].ToString( ); } if (row ["DK007"] != null) { model.DK007 = row ["DK007"].ToString( ); } if (row ["DK008"] != null) { model.DK008 = row ["DK008"].ToString( ); } if (row ["DK009"] != null && row ["DK009"].ToString( ) != "") { model.DK009 = DateTime.Parse(row ["DK009"].ToString( )); } if (row ["DK010"] != null && row ["DK010"].ToString( ) != "") { model.DK010 = int.Parse(row ["DK010"].ToString( )); } if (row ["DK011"] != null && row ["DK011"].ToString( ) != "") { model.DK011 = int.Parse(row ["DK011"].ToString( )); } if (row ["DK012"] != null && row ["DK012"].ToString( ) != "") { model.DK012 = DateTime.Parse(row ["DK012"].ToString( )); } if (row ["DK013"] != null && row ["DK013"].ToString( ) != "") { model.DK013 = DateTime.Parse(row ["DK013"].ToString( )); } if (row ["DK014"] != null && row ["DK014"].ToString( ) != "") { model.DK014 = DateTime.Parse(row ["DK014"].ToString( )); } if (row ["DK015"] != null && row ["DK015"].ToString( ) != "") { model.DK015 = DateTime.Parse(row ["DK015"].ToString( )); } if (row ["DK016"] != null) { model.DK016 = row ["DK016"].ToString( ); } if (row ["DK017"] != null && row ["DK017"].ToString( ) != "") { model.DK017 = DateTime.Parse(row ["DK017"].ToString( )); } if (row ["DK018"] != null) { model.DK018 = row ["DK018"].ToString( ); } if (row ["DK019"] != null && row ["DK019"].ToString( ) != "") { model.DK019 = int.Parse(row ["DK019"].ToString( )); } if (row ["DK020"] != null) { model.DK020 = row ["DK020"].ToString( ); } if (row ["DK021"] != null) { model.DK021 = row ["DK021"].ToString( ); } if (row ["DK022"] != null) { model.DK022 = row ["DK022"].ToString( ); } if (row ["DK023"] != null) { model.DK023 = row ["DK023"].ToString( ); } if (row ["DK024"] != null) { model.DK024 = row ["DK024"].ToString( ); } if (row ["DK025"] != null) { model.DK025 = row ["DK025"].ToString( ); } if (row ["DK026"] != null) { model.DK026 = row ["DK026"].ToString( ); } if (row ["DK027"] != null) { model.DK027 = row ["DK027"].ToString( ); } if (row ["DK028"] != null) { model.DK028 = row ["DK028"].ToString( ); } if (row ["DK029"] != null) { model.DK029 = row ["DK029"].ToString( ); } if (row ["DK030"] != null) { model.DK030 = row ["DK030"].ToString( ); } if (row ["DK031"] != null) { model.DK031 = row ["DK031"].ToString( ); } if (row ["DK032"] != null) { model.DK032 = row ["DK032"].ToString( ); } if (row ["DK033"] != null) { model.DK033 = row ["DK033"].ToString( ); } if (row ["DK034"] != null) { model.DK034 = row ["DK034"].ToString( ); } if (row ["DK035"] != null) { model.DK035 = row ["DK035"].ToString( ); } if (row ["DK036"] != null) { model.DK036 = row ["DK036"].ToString( ); } if (row ["DK037"] != null) { model.DK037 = row ["DK037"].ToString( ); } if (row ["DK038"] != null) { model.DK038 = row ["DK038"].ToString( ); } if (row ["DK039"] != null) { model.DK039 = row ["DK039"].ToString( ); } } return(model); }
/// <summary> /// add data to r_pqdk /// </summary> /// <param name="model"></param> /// <param name="logins"></param> /// <returns></returns> public bool Save(MulaolaoLibrary.QualityReportDKEntity model, string logins, string state) { return(_dal.Save(model, logins, state)); }
void setValue( ) { model = _bll.getModel(model.DK001); if (model == null) { return; } secDK003.EditValue = model.DK002; txtDK002.Text = model.DK002; txtDK002.Tag = model.idx; txtDK004.Text = model.DK004; txtDK005.Text = model.DK005; txtDK006.Text = model.DK006; txtDK007.Text = model.DK007; txtDK008.Text = model.DK008; txtDK010.Text = model.DK010.ToString( ); txtDK011.Text = model.DK011.ToString( ); txtDK019.Text = model.DK019.ToString( ); txtDK032.Text = model.DK032; txtDK035.Text = model.DK035; txtDK037.Text = model.DK037; txtDK038.Text = model.DK038; txtDK039.Text = model.DK039; cmbDK016.Text = model.DK016; cmbDK018.Text = model.DK018; cmbDK020.Text = model.DK020; cmbDK021.Text = model.DK021; cmbDK022.Text = model.DK022; cmbDK023.Text = model.DK023; cmbDK024.Text = model.DK024; cmbDK025.Text = model.DK025; cmbDK026.Text = model.DK026; cmbDK027.Text = model.DK027; cmbDK028.Text = model.DK028; cmbDK029.Text = model.DK029; cmbDK030.Text = model.DK030; cmbDK031.Text = model.DK031; cmbDK033.Text = model.DK033; cmbDK034.Text = model.DK034; cmbDK036.Text = model.DK036; dtpDK009.Text = model.DK009.ToString( ); if (model.DK012 > DateTime.MinValue && model.DK012 < DateTime.MaxValue) { dtpDK012.Value = Convert.ToDateTime(model.DK012); } if (model.DK013 > DateTime.MinValue && model.DK013 < DateTime.MaxValue) { dtpDK013.Value = Convert.ToDateTime(model.DK013); } if (model.DK014 > DateTime.MinValue && model.DK014 < DateTime.MaxValue) { dtpDK014.Value = Convert.ToDateTime(model.DK014); } if (model.DK015 > DateTime.MinValue && model.DK015 < DateTime.MaxValue) { dtpDK015.Value = Convert.ToDateTime(model.DK015); } if (model.DK017 > DateTime.MinValue && model.DK017 < DateTime.MaxValue) { dtpDK017.Value = Convert.ToDateTime(model.DK017); } }