void assignMent( ) { _model = _bll.GetModel(_model.IDX); textBox1.Text = _model.PZ002; textBox2.Text = _model.PZ003; textBox3.Text = _model.PZ005; textBox4.Text = _model.PZ004; textBox5.Text = _model.PZ006.ToString( ); if (_model.PZ007 > DateTime.MinValue && _model.PZ007 < DateTime.MaxValue) { dateTimePicker1.Value = _model.PZ007; } if (_model.PZ008 > DateTime.MinValue && _model.PZ008 < DateTime.MaxValue) { dateTimePicker2.Value = _model.PZ008; } textBox9.Text = _model.PZ017.ToString( ); textBox7.Text = _model.PZ023; textBox6.Text = _model.PZ021; textBox8.Text = _model.PZ024; if (_model.PZ022 > DateTime.MinValue && _model.PZ022 < DateTime.MaxValue) { dateTimePicker3.Value = _model.PZ022; } if (_model.PZ025 > DateTime.MinValue && _model.PZ025 < DateTime.MaxValue) { dateTimePicker4.Value = _model.PZ025; } textBox10.Text = _model.PZ036.ToString( ); }
public bool Delete( ) { ArrayList SQLString = new ArrayList( ); MulaolaoLibrary.GunQiChenBenLibrary _model = new MulaolaoLibrary.GunQiChenBenLibrary( ); StringBuilder strSql = new StringBuilder( ); strSql.Append("SELECT PZ003,PZ009,PZ010,PZ013,PZ014,PZ027 FROM R_PQPZ GROUP BY PZ003,PZ009,PZ010,PZ013,PZ014,PZ027 HAVING COUNT(1)>1"); DataTable da = SqlHelper.ExecuteDataTable(strSql.ToString( )); if (da != null && da.Rows.Count > 0) { for (int i = 0; i < da.Rows.Count; i++) { _model.PZ003 = _model.PZ009 = _model.PZ010 = _model.PZ013 = _model.PZ014 = _model.PZ027 = ""; _model.PZ003 = da.Rows[i]["PZ003"].ToString( ); _model.PZ009 = da.Rows[i]["PZ009"].ToString( ); _model.PZ010 = da.Rows[i]["PZ010"].ToString( ); _model.PZ013 = da.Rows[i]["PZ013"].ToString( ); _model.PZ014 = da.Rows[i]["PZ014"].ToString( ); _model.PZ027 = da.Rows[i]["PZ027"].ToString( ); SQLString.Add(deleteOf(_model)); } } return(SqlHelper.ExecuteSqlTran(SQLString)); }
string deleteOf(MulaolaoLibrary.GunQiChenBenLibrary _model) { StringBuilder strSql = new StringBuilder( ); strSql.AppendFormat("DELETE FROM R_PQPZ WHERE idx =(SELECT TOP 1 idx FROM R_PQPZ WHERE PZ003='{0}' AND PZ009='{1}' AND PZ010='{2}' AND PZ013='{3}' AND PZ014='{4}' AND PZ027='{5}' ORDER BY idx DESC )", _model.PZ003, _model.PZ009, _model.PZ010, _model.PZ013, _model.PZ014, _model.PZ027); return(strSql.ToString( )); }
protected override void select( ) { base.select( ); _model = new MulaolaoLibrary.GunQiChenBenLibrary( ); SelectAll.GunQiChenBenAll gunQi = new SelectAll.GunQiChenBenAll( ); gunQi.StartPosition = FormStartPosition.CenterScreen; gunQi.PassDataBetweenForm += new SelectAll.GunQiChenBenAll.PassDataBetweenFormHandler(gunQi_PassDataBetweenForm); gunQi.ShowDialog( ); if (_model.PZ001 != null) { autoQuery( ); } }
/// <summary> /// 编辑一条记录 /// </summary> /// <param name="_model"></param> /// <returns></returns> public bool Update(MulaolaoLibrary.GunQiChenBenLibrary _model, string logins) { Hashtable SQLString = new Hashtable( ); StringBuilder strSql = new StringBuilder( ); strSql.Append("UPDATE R_PQPZ SET "); strSql.AppendFormat("PZ017=@PZ017,"); strSql.AppendFormat("PZ036=@PZ036"); strSql.AppendFormat(" WHERE idx=@idx"); SqlParameter [] parameter = { new SqlParameter("@PZ017", SqlDbType.Decimal, 6), new SqlParameter("@PZ036", SqlDbType.Decimal, 6), new SqlParameter("@idx", SqlDbType.Int) }; parameter [0].Value = _model.PZ017; parameter [1].Value = _model.PZ036; parameter [2].Value = _model.IDX; SQLString.Add(strSql, parameter); SQLString.Add(Drity.DrityOfComparation("R_346", "产品滚漆成本汇总表(R_346)", logins, DateTime.Now, _model.PZ001, strSql.ToString( ).Replace("'", "''"), "编辑", "编辑"), null); return(SqlHelper.ExecuteSqlTran(SQLString)); }
/// <summary> /// 获取数据集 /// </summary> /// <param name="row"></param> /// <returns></returns> public MulaolaoLibrary.GunQiChenBenLibrary GetDataRow(DataRow row) { MulaolaoLibrary.GunQiChenBenLibrary _model = new MulaolaoLibrary.GunQiChenBenLibrary( ); if (row != null) { if (row["idx"] != null && row["idx"].ToString( ) != "") { _model.IDX = int.Parse(row["idx"].ToString( )); } if (row["PZ001"] != null && row["PZ001"].ToString( ) != "") { _model.PZ001 = row["PZ001"].ToString( ); } if (row["PZ002"] != null && row["PZ002"].ToString( ) != "") { _model.PZ002 = row["PZ002"].ToString( ); } if (row["PZ003"] != null && row["PZ003"].ToString( ) != "") { _model.PZ003 = row["PZ003"].ToString( ); } if (row["PZ004"] != null && row["PZ004"].ToString( ) != "") { _model.PZ004 = row["PZ004"].ToString( ); } if (row["PZ005"] != null && row["PZ005"].ToString( ) != "") { _model.PZ005 = row["PZ005"].ToString( ); } if (row["PZ006"] != null && row["PZ006"].ToString( ) != "") { _model.PZ006 = long.Parse(row["PZ006"].ToString( )); } if (row["PZ007"] != null && row["PZ007"].ToString( ) != "") { _model.PZ007 = DateTime.Parse(row["PZ007"].ToString( )); } if (row["PZ008"] != null && row["PZ008"].ToString( ) != "") { _model.PZ008 = DateTime.Parse(row["PZ008"].ToString( )); } if (row["PZ017"] != null && row["PZ017"].ToString( ) != "") { _model.PZ017 = decimal.Parse(row["PZ017"].ToString( )); } if (row["PZ018"] != null && row["PZ018"].ToString( ) != "") { _model.PZ018 = decimal.Parse(row["PZ018"].ToString( )); } if (row["PZ021"] != null && row["PZ021"].ToString( ) != "") { _model.PZ021 = row["PZ021"].ToString( ); } if (row["PZ022"] != null && row["PZ022"].ToString( ) != "") { _model.PZ022 = DateTime.Parse(row["PZ022"].ToString( )); } if (row["PZ023"] != null && row["PZ023"].ToString( ) != "") { _model.PZ023 = row["PZ023"].ToString( ); } if (row["PZ024"] != null && row["PZ024"].ToString( ) != "") { _model.PZ024 = row["PZ024"].ToString( ); } if (row["PZ025"] != null && row["PZ025"].ToString( ) != "") { _model.PZ025 = DateTime.Parse(row["PZ025"].ToString( )); } if (row["PZ036"] != null && row["PZ036"].ToString( ) != "") { _model.PZ036 = decimal.Parse(row["PZ036"].ToString( )); } if (row["PZ037"] != null && row["PZ037"].ToString( ) != "") { _model.PZ037 = row["PZ037"].ToString( ); } } return(_model); }
/// <summary> /// 是否存在记录 /// </summary> /// <param name="_model"></param> /// <returns></returns> public bool Update(MulaolaoLibrary.GunQiChenBenLibrary _model, string logins) { return(_dao.Update(_model, logins)); }