Beispiel #1
0
        public M_User_Level GetModelFromReader(DbDataReader rdr)
        {
            M_User_Level model = new M_User_Level();

            model.ID           = Convert.ToInt32(rdr["ID"]);
            model.Alias        = ConverToStr(rdr["Alias"]);
            model.Image        = ConverToStr(rdr["Image"]);
            model.DiscountRate = ConverToDouble(rdr["DiscountRate"]);
            model.PointRate    = ConverToDouble(rdr["PointRate"]);
            model.Addon1       = ConverToStr(rdr["Addon1"]);
            model.Addon2       = ConverToStr(rdr["Addon2"]);
            model.StoreID      = ConvertToInt(rdr["StoreID"]);
            model.OrderID      = ConvertToInt(rdr["OrderID"]);
            model.Remark       = ConverToStr(rdr["Remark"]);
            model.ZStatus      = ConvertToInt(rdr["ZStatus"]);
            model.ZType        = ConvertToInt(rdr["ZType"]);
            model.CDate        = ConvertToDate(rdr["CDate"]);
            rdr.Close();
            return(model);
        }
Beispiel #2
0
        public override SqlParameter[] GetParameters()
        {
            M_User_Level model = this;

            SqlParameter[] sp = GetSP();
            if (model.CDate <= DateTime.MinValue)
            {
                model.CDate = DateTime.Now;
            }
            sp[0].Value  = model.ID;
            sp[1].Value  = model.Alias;
            sp[2].Value  = model.Image;
            sp[3].Value  = model.DiscountRate;
            sp[4].Value  = model.PointRate;
            sp[5].Value  = model.Addon1;
            sp[6].Value  = model.Addon2;
            sp[7].Value  = model.StoreID;
            sp[8].Value  = model.OrderID;
            sp[9].Value  = model.Remark;
            sp[10].Value = model.ZStatus;
            sp[11].Value = model.ZType;
            sp[12].Value = model.CDate;
            return(sp);
        }