Esempio n. 1
0
        internal static ZZInfo GetInfoById(int innerid)
        {
            ZZInfo    info = new ZZInfo();
            DataTable dt   = SQLHelper.ExecuteDataTable("select * from T_zz where id = @id", innerid);

            info.Id      = innerid;
            info.Money   = Convert.ToDecimal(dt.Rows[0]["money"].ToString());
            info.Reason  = dt.Rows[0]["reason"].ToString();
            info.PreDate = Convert.ToDateTime(dt.Rows[0]["predate"]);
            return(info);
        }
Esempio n. 2
0
        internal static int UpdateInfo(ZZInfo zzinfo, int id)
        {
            object obj = SQLHelper.ExecuteNonQuery("update T_zz set money=@money, reason=@reason, predate=@predate where id=@id", zzinfo.Money, zzinfo.Reason, zzinfo.PreDate, id);

            return(Convert.ToInt32(obj));
        }
Esempio n. 3
0
        internal static int AddInfo(ZZInfo zzinfo)
        {
            object obj = SQLHelper.ExecuteScalar("insert into T_zz(money, reason, predate) output inserted.id values(@money, @reason, @predate)", zzinfo.Money, zzinfo.Reason, zzinfo.PreDate);

            return(Convert.ToInt32(obj));
        }