Exemplo n.º 1
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        private static PeopleTicket DataRowToModel(SQLiteDataReader row)
        {
            PeopleTicket model = new PeopleTicket();

            if (row != null)
            {
                if (row["id"] != null && row["id"].ToString() != "")
                {
                    model.Id = int.Parse(row["id"].ToString());
                }
                if (row["user_id"] != null && row["user_id"].ToString() != "")
                {
                    model.UserId = int.Parse(row["user_id"].ToString());
                    model.People = PeopleDAL.GetPeopleByUserId(model.UserId);
                    model.Wechat = WechatDAL.GetWechatByUserId(model.UserId);
                    model.Member = MemberDAL.GetMemberByUserId(model.UserId);
                }
                if (row["order_id"] != null && row["order_id"].ToString() != "")
                {
                    model.OrderId = int.Parse(row["order_id"].ToString());
                }
                if (row["date"] != null && row["date"].ToString() != "")
                {
                    model.Date = model.ConvertIntDateTime(int.Parse(row["date"].ToString()));
                }
                if (row["num"] != null && row["num"].ToString() != "")
                {
                    model.Num = int.Parse(row["num"].ToString());
                }
                if (row["status"] != null && row["status"].ToString() != "")
                {
                    model.Status = row["status"].ToString();
                }
                if (row["created_at"] != null && row["created_at"].ToString() != "")
                {
                    model.CreatedAt = model.ConvertIntDateTime(int.Parse(row["created_at"].ToString()));
                }
                if (row["updated_at"] != null && row["updated_at"].ToString() != "")
                {
                    model.UpdatedAt = model.ConvertIntDateTime(int.Parse(row["updated_at"].ToString()));
                }
            }
            return(model);
        }
Exemplo n.º 2
0
 public MemberBUS()
 {
     memberDAL = new MemberDAL();
 }