Exemple #1
0
        internal static GDZCInfo GetInfoById(int innerid)
        {
            GDZCInfo  info = new GDZCInfo();
            DataTable dt   = SQLHelper.ExecuteDataTable("select * from T_gdzc where id = @id", innerid);

            info.Id          = innerid;
            info.DeviceName  = dt.Rows[0]["devicename"].ToString();
            info.Count       = Convert.ToInt32(dt.Rows[0]["count"].ToString());
            info.Description = dt.Rows[0]["description"].ToString();
            info.SinglePrice = Convert.ToDecimal(dt.Rows[0]["singleprice"].ToString());
            info.TotalPrice  = Convert.ToDecimal(dt.Rows[0]["totalprice"].ToString());
            info.NeedDate    = Convert.ToDateTime(dt.Rows[0]["needdate"]);
            return(info);
        }
Exemple #2
0
        internal static int UpdateInfo(GDZCInfo gdzcinfo, int id)
        {
            object obj = SQLHelper.ExecuteNonQuery("update T_gdzc set devicename=@devicename, count=@count, description=@description, singleprice=@singleprice, totalprice=@totalprice, needdate=@needdate where id=@id", gdzcinfo.DeviceName, gdzcinfo.Count, gdzcinfo.Description, gdzcinfo.SinglePrice, gdzcinfo.TotalPrice, gdzcinfo.NeedDate, id);

            return(Convert.ToInt32(obj));
        }
Exemple #3
0
        internal static int AddInfo(GDZCInfo gdzcinfo)
        {
            object obj = SQLHelper.ExecuteScalar("insert into T_gdzc(devicename, count, description, singleprice, totalprice, needdate) output inserted.id values(@devicename, @count, @description, @singleprice, @totalprice, @needdate)", gdzcinfo.DeviceName, gdzcinfo.Count, gdzcinfo.Description, gdzcinfo.SinglePrice, gdzcinfo.TotalPrice, gdzcinfo.NeedDate);

            return(Convert.ToInt32(obj));
        }