public int Update(DailyPayAmtRestrictInfo oParam) { string sql = @"UPDATE Fin_DailyPayAmtRestrict SET TopPublicPayAmt=@TopPublicPayAmt, AllocatedPublicAmt=@AllocatedPublicAmt, TopPrivatePayAmt=@TopPrivatePayAmt, AllocatedPrivateAmt=@AllocatedPrivateAmt, CreateUserSysNo=@CreateUserSysNo, CreateTime=@CreateTime WHERE SysNo=@SysNo"; SqlCommand cmd = new SqlCommand(sql); SqlParameter paramSysNo = new SqlParameter("@SysNo", SqlDbType.Int, 4); SqlParameter paramTopPublicPayAmt = new SqlParameter("@TopPublicPayAmt", SqlDbType.Decimal, 9); SqlParameter paramAllocatedPublicAmt = new SqlParameter("@AllocatedPublicAmt", SqlDbType.Decimal, 9); SqlParameter paramTopPrivatePayAmt = new SqlParameter("@TopPrivatePayAmt", SqlDbType.Decimal, 9); SqlParameter paramAllocatedPrivateAmt = new SqlParameter("@AllocatedPrivateAmt", SqlDbType.Decimal, 9); SqlParameter paramCreateUserSysNo = new SqlParameter("@CreateUserSysNo", SqlDbType.Int, 4); SqlParameter paramCreateTime = new SqlParameter("@CreateTime", SqlDbType.DateTime); if (oParam.SysNo != AppConst.IntNull) paramSysNo.Value = oParam.SysNo; else paramSysNo.Value = System.DBNull.Value; if (oParam.TopPublicPayAmt != AppConst.DecimalNull) paramTopPublicPayAmt.Value = oParam.TopPublicPayAmt; else paramTopPublicPayAmt.Value = System.DBNull.Value; if (oParam.AllocatedPublicAmt != AppConst.DecimalNull) paramAllocatedPublicAmt.Value = oParam.AllocatedPublicAmt; else paramAllocatedPublicAmt.Value = System.DBNull.Value; if (oParam.TopPrivatePayAmt != AppConst.DecimalNull) paramTopPrivatePayAmt.Value = oParam.TopPrivatePayAmt; else paramTopPrivatePayAmt.Value = System.DBNull.Value; if (oParam.AllocatedPrivateAmt != AppConst.DecimalNull) paramAllocatedPrivateAmt.Value = oParam.AllocatedPrivateAmt; else paramAllocatedPrivateAmt.Value = System.DBNull.Value; if (oParam.CreateUserSysNo != AppConst.IntNull) paramCreateUserSysNo.Value = oParam.CreateUserSysNo; else paramCreateUserSysNo.Value = System.DBNull.Value; if (oParam.CreateTime != AppConst.DateTimeNull) paramCreateTime.Value = oParam.CreateTime; else paramCreateTime.Value = System.DBNull.Value; cmd.Parameters.Add(paramSysNo); cmd.Parameters.Add(paramTopPublicPayAmt); cmd.Parameters.Add(paramAllocatedPublicAmt); cmd.Parameters.Add(paramTopPrivatePayAmt); cmd.Parameters.Add(paramAllocatedPrivateAmt); cmd.Parameters.Add(paramCreateUserSysNo); cmd.Parameters.Add(paramCreateTime); return SqlHelper.ExecuteNonQuery(cmd); }
public int Insert(DailyPayAmtRestrictInfo oParam) { string sql = @"INSERT INTO Fin_DailyPayAmtRestrict ( TopPublicPayAmt, AllocatedPublicAmt, TopPrivatePayAmt, AllocatedPrivateAmt, CreateUserSysNo, CreateTime ) VALUES ( @TopPublicPayAmt, @AllocatedPublicAmt, @TopPrivatePayAmt, @AllocatedPrivateAmt, @CreateUserSysNo, @CreateTime );set @SysNo = SCOPE_IDENTITY();"; SqlCommand cmd = new SqlCommand(sql); SqlParameter paramSysNo = new SqlParameter("@SysNo", SqlDbType.Int, 4); SqlParameter paramTopPublicPayAmt = new SqlParameter("@TopPublicPayAmt", SqlDbType.Decimal, 9); SqlParameter paramAllocatedPublicAmt = new SqlParameter("@AllocatedPublicAmt", SqlDbType.Decimal, 9); SqlParameter paramTopPrivatePayAmt = new SqlParameter("@TopPrivatePayAmt", SqlDbType.Decimal, 9); SqlParameter paramAllocatedPrivateAmt = new SqlParameter("@AllocatedPrivateAmt", SqlDbType.Decimal, 9); SqlParameter paramCreateUserSysNo = new SqlParameter("@CreateUserSysNo", SqlDbType.Int, 4); SqlParameter paramCreateTime = new SqlParameter("@CreateTime", SqlDbType.DateTime); paramSysNo.Direction = ParameterDirection.Output; if (oParam.TopPublicPayAmt != AppConst.DecimalNull) paramTopPublicPayAmt.Value = oParam.TopPublicPayAmt; else paramTopPublicPayAmt.Value = System.DBNull.Value; if (oParam.AllocatedPublicAmt != AppConst.DecimalNull) paramAllocatedPublicAmt.Value = oParam.AllocatedPublicAmt; else paramAllocatedPublicAmt.Value = System.DBNull.Value; if (oParam.TopPrivatePayAmt != AppConst.DecimalNull) paramTopPrivatePayAmt.Value = oParam.TopPrivatePayAmt; else paramTopPrivatePayAmt.Value = System.DBNull.Value; if (oParam.AllocatedPrivateAmt != AppConst.DecimalNull) paramAllocatedPrivateAmt.Value = oParam.AllocatedPrivateAmt; else paramAllocatedPrivateAmt.Value = System.DBNull.Value; if (oParam.CreateUserSysNo != AppConst.IntNull) paramCreateUserSysNo.Value = oParam.CreateUserSysNo; else paramCreateUserSysNo.Value = System.DBNull.Value; if (oParam.CreateTime != AppConst.DateTimeNull) paramCreateTime.Value = oParam.CreateTime; else paramCreateTime.Value = System.DBNull.Value; cmd.Parameters.Add(paramSysNo); cmd.Parameters.Add(paramTopPublicPayAmt); cmd.Parameters.Add(paramAllocatedPublicAmt); cmd.Parameters.Add(paramTopPrivatePayAmt); cmd.Parameters.Add(paramAllocatedPrivateAmt); cmd.Parameters.Add(paramCreateUserSysNo); cmd.Parameters.Add(paramCreateTime); return SqlHelper.ExecuteNonQuery(cmd, out oParam.SysNo); }
private void map(DailyPayAmtRestrictInfo oParam, DataRow tempdr) { oParam.SysNo = Util.TrimIntNull(tempdr["SysNo"]); oParam.TopPublicPayAmt = Util.TrimDecimalNull(tempdr["TopPublicPayAmt"]); oParam.AllocatedPublicAmt = Util.TrimDecimalNull(tempdr["AllocatedPublicAmt"]); oParam.TopPrivatePayAmt = Util.TrimDecimalNull(tempdr["TopPrivatePayAmt"]); oParam.AllocatedPrivateAmt = Util.TrimDecimalNull(tempdr["AllocatedPrivateAmt"]); oParam.CreateUserSysNo = Util.TrimIntNull(tempdr["CreateUserSysNo"]); oParam.CreateTime = Util.TrimDateNull(tempdr["CreateTime"]); }
public void UpdateDailyPayAmtRestrict(DailyPayAmtRestrictInfo oParam) { if (1 != new DailyPayAmtRestrictDac().Update(oParam)) { throw new BizException("����ʧ��"); } }
/// <summary> /// ����ÿ��֧��������� ������Ҫһ������ /// </summary> /// <param name="SysNo">��֪������ֵ���Դ�AppConst.IntNull</param> /// <param name="date">��֪������ֵ���Դ�AppConst.DateTimeNull</param> /// <returns></returns> public DailyPayAmtRestrictInfo LoadDailyPayAmtRestrict(int SysNo, DateTime date) { string sql = "SELECT * FROM dbo.Fin_DailyPayAmtRestrict WHERE 1=1 "; if (SysNo != AppConst.IntNull) sql += " AND SysNo =" + SysNo; if (date != AppConst.DateTimeNull) { sql += " AND CreateTime >=" + Util.ToSqlString(Util.TrimDateNull(date.ToString(AppConst.DateFormat)).ToString(AppConst.DateFormatLong)); sql += " AND CreateTime <=" + Util.ToSqlEndDate(date.ToString(AppConst.DateFormat)); } DataSet ds = SqlHelper.ExecuteDataSet(sql); if (!Util.HasMoreRow(ds)) return null; else { DailyPayAmtRestrictInfo oInfo = new DailyPayAmtRestrictInfo(); map(oInfo, ds.Tables[0].Rows[0]); return oInfo; } }
public void InsertDailyPayAmtRestrict(DailyPayAmtRestrictInfo oParam) { string sql = "SELECT * FROM dbo.Fin_DailyPayAmtRestrict"; sql += " WHERE CreateTime >= " + Util.ToSqlString(oParam.CreateTime.ToString(AppConst.DateFormat)); sql += " AND CreateTime <= " + Util.ToSqlEndDate(oParam.CreateTime.ToString(AppConst.DateFormat)); DataSet ds = SqlHelper.ExecuteDataSet(sql); if (Util.HasMoreRow(ds)) { throw new BizException("�Ѿ����ڽ��յ�֧��������ƣ�����Ҫ�����"); } else if (1 != new DailyPayAmtRestrictDac().Insert(oParam)) { throw new BizException("����ʧ��"); } }