public M_Cart GetModelFromReader(DataRow rdr) { M_Cart model = new M_Cart(); model.ID = Convert.ToInt32(rdr["ID"]); model.Cartid = ConverToStr(rdr["Cartid"]); model.Username = ConverToStr(rdr["Username"]); model.Addtime = ConvertToDate(rdr["Addtime"]); model.StoreID = Convert.ToInt32(rdr["StoreID"]); model.ProID = Convert.ToInt32(rdr["ProID"]); model.Pronum = Convert.ToInt32(rdr["Pronum"]); model.AllMoney = Convert.ToDouble(rdr["AllMoney"]); model.FarePrice = ConverToStr(rdr["FarePrice"]); model.Additional = ConverToStr(rdr["Additional"]); model.AllMoney_Json = ConverToStr(rdr["AllMoney_Json"]); model.code = ConverToStr(rdr["code"]); model.Proname = ConverToStr(rdr["Proname"]); model.Remark = ConverToStr(rdr["Remark"]); try { //兼容CartPro if (rdr.Table.Columns.Contains("shijia")) { model.FarePrice = ConverToStr(rdr["Shijia"]); } model.userid = Convert.ToInt32(rdr["userid"]); model.ProAttr = ConverToStr(rdr["ProAttr"]); } catch { } return(model); }
public M_Cart GetModelFromReader(DbDataReader rdr) { M_Cart model = new M_Cart(); model.ID = Convert.ToInt32(rdr["ID"]); model.Cartid = ConverToStr(rdr["Cartid"]); model.userid = Convert.ToInt32(rdr["userid"]); model.Username = ConverToStr(rdr["Username"]); model.Addtime = ConvertToDate(rdr["Addtime"]); model.StoreID = Convert.ToInt32(rdr["StoreID"]); model.ProID = Convert.ToInt32(rdr["ProID"]); model.Pronum = Convert.ToInt32(rdr["Pronum"]); model.AllMoney = Convert.ToDouble(rdr["AllMoney"]); model.FarePrice = ConverToStr(rdr["FarePrice"]); model.Additional = ConverToStr(rdr["Additional"]); model.AllMoney_Json = ConverToStr(rdr["AllMoney_Json"]); model.code = ConverToStr(rdr["code"]); model.Proname = ConverToStr(rdr["Proname"]); model.ProAttr = ConverToStr(rdr["ProAttr"]); model.Remark = ConverToStr(rdr["Remark"]); rdr.Close(); return(model); }
public override SqlParameter[] GetParameters() { M_Cart model = this; SqlParameter[] sp = GetSP(); sp[0].Value = model.ID; sp[1].Value = model.Cartid; sp[2].Value = model.userid; sp[3].Value = model.Username; sp[4].Value = model.Addtime; sp[5].Value = model.StoreID; sp[6].Value = model.ProID; sp[7].Value = model.Pronum; sp[8].Value = model.AllMoney; sp[9].Value = model.FarePrice; sp[10].Value = model.Additional; sp[11].Value = model.AllMoney_Json; sp[12].Value = model.code; sp[13].Value = model.Proname; sp[14].Value = model.ProAttr; sp[15].Value = model.Remark; return(sp); }