public string UpdateOfOutSource(MulaolaoLibrary.CostIndexOneLibrary _model) { StringBuilder strSql = new StringBuilder( ); strSql.Append("UPDATE R_PQAW SET "); strSql.AppendFormat("AW002='{0}'", _model.AW002); strSql.AppendFormat(" WHERE AW001='{0}'", _model.AW001); return(strSql.ToString( )); }
public string UpdateOfWages(MulaolaoLibrary.CostIndexOneLibrary _model) { StringBuilder strSql = new StringBuilder( ); strSql.Append("UPDATE R_PQAX SET "); strSql.AppendFormat("AX019='{0}'", _model.AX019); strSql.AppendFormat(" WHERE AX001='{0}' AND AX002='{1}'", _model.AX001, _model.AX002); return(strSql.ToString( )); }
public string AddOfPaid(MulaolaoLibrary.CostIndexOneLibrary _model) { StringBuilder strSql = new StringBuilder( ); strSql.Append("INSERT INTO R_PQAX ("); strSql.Append("AX001,AX002,AX012)"); strSql.Append(" VALUES ("); strSql.AppendFormat("'{0}','{1}','{2}')", _model.AX001, _model.AX002, _model.AX012); return(strSql.ToString( )); }
public string AddOfSail(MulaolaoLibrary.CostIndexOneLibrary _model) { StringBuilder strSql = new StringBuilder( ); strSql.Append("INSERT INTO R_PQAX ("); strSql.Append("AX001,AX002,AX004,AX005,AX006,AX007,AX008,AX009)"); strSql.Append(" VALUES ("); strSql.AppendFormat("'{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}')", _model.AX001, _model.AX002, _model.AX004, _model.AX005, _model.AX006, _model.AX007, _model.AX008, _model.AX009); return(strSql.ToString( )); }
public string AddOfOutSource(MulaolaoLibrary.CostIndexOneLibrary _model) { StringBuilder strSql = new StringBuilder( ); strSql.Append("INSERT INTO R_PQAW ("); strSql.Append("AW001,AW002)"); strSql.Append(" VALUES ("); strSql.AppendFormat("'{0}','{1}')", _model.AW001, _model.AW002); return(strSql.ToString( )); }
public string UpdateOfSail(MulaolaoLibrary.CostIndexOneLibrary _model) { StringBuilder strSql = new StringBuilder( ); strSql.Append("UPDATE R_PQAX SET "); strSql.AppendFormat("AX004='{0}',", _model.AX004); strSql.AppendFormat("AX005='{0}',", _model.AX005); strSql.AppendFormat("AX006='{0}',", _model.AX006); strSql.AppendFormat("AX007='{0}',", _model.AX007); strSql.AppendFormat("AX008='{0}',", _model.AX008); strSql.AppendFormat("AX009='{0}'", _model.AX009); strSql.AppendFormat(" WHERE AX001='{0}' AND AX002='{1}'", _model.AX001, _model.AX002); return(strSql.ToString( )); }
/// <summary> /// 生成年度报表 /// </summary> /// <param name="_model"></param> /// <returns></returns> public bool GetDataTableGenerate(MulaolaoLibrary.CostIndexOneLibrary _model) { return(_dao.GetDataTableGenerate(_model)); }
/// <summary> /// 生成年度报表 /// </summary> /// <param name="_model"></param> /// <returns></returns> public bool GetDataTableGenerate(MulaolaoLibrary.CostIndexOneLibrary _model) { ArrayList SQLString = new ArrayList( ); DataTable da = new DataTable( ); da = GetDataTableOfDelivery(_model.AX001.Year); if (da != null && da.Rows.Count > 0) { _model.AV002 = string.IsNullOrEmpty(da.Rows[0]["AE"].ToString( )) == true ? 0 : Convert.ToInt32(da.Rows[0]["AE"].ToString( )); if (ExistsOfDelivery(_model.AV001)) { SQLString.Add(UpdateOfDelivery(_model)); } else { SQLString.Add(AddOfDelivery(_model)); } } da = GetDataTableOfOutSource(_model.AW001.Year); if (da != null && da.Rows.Count > 0) { _model.AW002 = string.IsNullOrEmpty(da.Rows[0]["AE"].ToString( )) == true ? 0 : Convert.ToInt32(da.Rows[0]["AE"].ToString( )); if (ExistsOfOutSource(_model.AW001)) { SQLString.Add(UpdateOfOutSource(_model)); } else { SQLString.Add(AddOfOutSource(_model)); } } da = GetDataTableOfSail(_model.AX001.Year); if (da != null && da.Rows.Count > 0) { for (int i = 0; i < da.Rows.Count; i++) { _model.AX002 = da.Rows[i]["AE08"].ToString( ); if (_model.AX002 == "") { _model.AX002 = "生产部"; } _model.AX004 = string.IsNullOrEmpty(da.Rows[i]["AE"].ToString( )) == true ? 0 : Convert.ToInt32(da.Rows[i]["AE"].ToString( )); _model.AX005 = string.IsNullOrEmpty(da.Rows[i]["AE1"].ToString( )) == true ? 0 : Convert.ToInt32(da.Rows[i]["AE1"].ToString( )); _model.AX006 = string.IsNullOrEmpty(da.Rows[i]["AE2"].ToString( )) == true ? 0 : Convert.ToInt32(da.Rows[i]["AE2"].ToString( )); _model.AX007 = string.IsNullOrEmpty(da.Rows[i]["AE3"].ToString( )) == true ? 0 : Convert.ToInt32(da.Rows[i]["AE3"].ToString( )); _model.AX008 = string.IsNullOrEmpty(da.Rows[i]["AE5"].ToString( )) == true ? 0 : Convert.ToInt32(da.Rows[i]["AE5"].ToString( )); _model.AX009 = string.IsNullOrEmpty(da.Rows[i]["AE4"].ToString( )) == true ? 0 : Convert.ToInt32(da.Rows[i]["AE4"].ToString( )); if (ExistsOfSail(_model.AX001, _model.AX002)) { SQLString.Add(UpdateOfSail(_model)); } else { SQLString.Add(AddOfSail(_model)); } } } if (SqlHelper.ExecuteSqlTran(SQLString)) { SQLString = new ArrayList( ); da = GetDataTableOfPaid(_model.AX001.Year); if (da != null && da.Rows.Count > 0) { for (int i = 0; i < da.Rows.Count; i++) { _model.AX002 = da.Rows[i]["AM008"].ToString( ); _model.AX012 = string.IsNullOrEmpty(da.Rows[i]["U"].ToString( )) == true ? 0 : Convert.ToInt32(da.Rows[i]["U"].ToString( )); if (ExistsOfSail(_model.AX001, _model.AX002)) { SQLString.Add(UpdateOfPaid(_model)); } else { SQLString.Add(AddOfPaid(_model)); } } } } if (SqlHelper.ExecuteSqlTran(SQLString)) { SQLString = new ArrayList( ); da = GetDataTableOfWages(_model.AX001.Year); if (da != null && da.Rows.Count > 0) { for (int i = 0; i < da.Rows.Count; i++) { _model.AX002 = da.Rows[i]["XZ004"].ToString( ); _model.AX019 = string.IsNullOrEmpty(da.Rows[i]["XZ"].ToString( )) == true ? 0 : Convert.ToInt32(da.Rows[i]["XZ"].ToString( )); if (ExistsOfSail(_model.AX001, _model.AX002)) { SQLString.Add(UpdateOfWages(_model)); } else { SQLString.Add(AddOfWages(_model)); } } } } UpdateOf(SQLString); return(SqlHelper.ExecuteSqlTran(SQLString)); }