示例#1
0
        public override SqlParameter[] GetParameters()
        {
            M_Shop_PrintDevice model = this;

            if (Since <= DateTime.MinValue)
            {
                Since = DateTime.Now;
            }
            if (LastConnected <= DateTime.MinValue)
            {
                LastConnected = DateTime.Now;
            }
            SqlParameter[] sp = GetSP();
            sp[0].Value = model.ID;
            sp[1].Value = model.DeviceNo;
            sp[2].Value = model.MemberCode;
            sp[3].Value = model.SecurityKey;
            sp[4].Value = model.Since;
            sp[5].Value = model.LastConnected;
            sp[6].Value = model.Alias;
            sp[7].Value = model.ShopName;
            sp[8].Value = model.Remind;
            sp[9].Value = model.IsDefault;
            return(sp);
        }
示例#2
0
        public M_Shop_PrintDevice GetModelFromReader(DbDataReader rdr)
        {
            M_Shop_PrintDevice model = new M_Shop_PrintDevice();

            model.ID            = ConvertToInt(rdr["ID"]);
            model.DeviceNo      = ConverToStr(rdr["DeviceNo"]);
            model.MemberCode    = ConverToStr(rdr["MemberCode"]);
            model.SecurityKey   = ConverToStr(rdr["SecurityKey"]);
            model.Since         = ConvertToDate(rdr["Since"]);
            model.LastConnected = ConvertToDate(rdr["LastConnected"]);
            model.Alias         = ConverToStr(rdr["Alias"]);
            model.ShopName      = ConverToStr(rdr["ShopName"]);
            model.Remind        = ConverToStr(rdr["Remind"]);
            model.IsDefault     = ConvertToInt(rdr["IsDefault"] ?? 0);
            rdr.Close();
            return(model);
        }