Ejemplo n.º 1
0
        public UserPlan(Protobuf.UserPlan userPlanPb)
        {
            this.Id       = userPlanPb.Id;
            this.UserId   = userPlanPb.UserId;
            this.RouteId  = userPlanPb.RouteId;
            this.FromDate = DateTime.FromBinary(userPlanPb.FromDate);
            this.ToDate   = DateTime.FromBinary(userPlanPb.ToDate);

            this.Route = new Route(userPlanPb.Route);
            this.User  = new User(userPlanPb.User);
        }
Ejemplo n.º 2
0
        public Protobuf.UserPlan ToPBMessage()
        {
            Protobuf.UserPlan userPlanPb = new Protobuf.UserPlan();
            userPlanPb.Id       = this.Id;
            userPlanPb.UserId   = this.UserId;
            userPlanPb.RouteId  = this.RouteId;
            userPlanPb.FromDate = this.FromDate.ToBinary();
            userPlanPb.ToDate   = this.ToDate.ToBinary();

            userPlanPb.Route = this.Route.ToPBMessage();
            userPlanPb.User  = this.User.ToPBMessage();
            return(userPlanPb);
        }