Ejemplo n.º 1
0
        public JsonResult AddClassDetail(FormCollection collection)
        {
            ViewClassDetail          entity = new ViewClassDetail();
            ClassDetailServiceClient client = new ClassDetailServiceClient();

            try
            {
                entity.Address   = collection["classDetailAddress"];
                entity.CenterID  = int.Parse(collection["classDetailCenterID"]);
                entity.Duration  = int.Parse(collection["classDetailDuration"]);
                entity.EndTime   = DateTime.Parse(collection["classDetailStartTime"]).AddMinutes(int.Parse(collection["classDetailDuration"]));
                entity.Level     = int.Parse(collection["classDetailLevel"]);
                entity.Name      = collection["classDetailName"];
                entity.Price     = decimal.Parse(collection["classDetailPrice"]);
                entity.StartTime = DateTime.Parse(collection["classDetailStartTime"]);
                entity.UserID    = user.Uid;
                entity.YID       = new YogisModelsServiceClient().GetYogisModelsById(user.Uid).YID;
                client.Add(entity);
                return(Json(new { code = 0 }));
            }
            catch (Exception e)
            {
                return(Json(new { code = 1 }));
            }
        }
Ejemplo n.º 2
0
        public List <ViewClassDetail> GetClassDetail(string whereStr, int page, int pagesize, out int count)
        {
            List <ClassDetail>     list  = _repository.GetClassDetail(whereStr, page, pagesize, out count);
            List <ViewClassDetail> model = new List <ViewClassDetail>();

            foreach (var item in list)
            {
                model.Add(ViewClassDetail.ToViewModel(item));
            }
            return(model);
        }
 public int updateEntity(ViewClassDetail entity)
 {
     try
     {
         return(Impl.updateEntity(entity));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public ViewClassDetail Add(ViewClassDetail entity)
 {
     try
     {
         return(Impl.Add(entity));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 5
0
        public int updateEntity(ViewClassDetail entity)
        {
            int result = _repository.updateEntity(ViewClassDetail.ToEntity(entity));

            return(result);
        }
Ejemplo n.º 6
0
        public ViewClassDetail Add(ViewClassDetail entity)
        {
            ClassDetail model = _repository.Add(ViewClassDetail.ToEntity(entity));

            return(ViewClassDetail.ToViewModel(model));
        }