Ejemplo n.º 1
0
        public void UpdateDataGroupTest()
        {
            UpdateDataGroupRequest request = new UpdateDataGroupRequest();

            request.Group = _groupUpdateData;
            UpdateDataGroupResponse response = _groupService.UpdateDataGroup(request);

            Assert.IsTrue(response.Messages.Count == 0, "Failed update data");
        }
Ejemplo n.º 2
0
        public UpdateDataGroupResponse UpdateDataGroup(UpdateDataGroupRequest request)
        {
            UpdateDataGroupResponse response = new UpdateDataGroupResponse();

            try
            {
                _groupRepo.Update(request.Group);
            }
            catch (Exception ex)
            {
                response.Messages.Add(ex.ToString());
            }
            return(response);
        }
Ejemplo n.º 3
0
        public JsonResult SaveGroup(Group group, string mode)
        {
            if (mode == "add")
            {
                InsertDataGroupRequest request = new InsertDataGroupRequest();
                request.Group = group;
                InsertDataGroupResponse response = _groupService.InsertDataGroup(request);

                return(Json(response.Messages.ToList(), JsonRequestBehavior.AllowGet));
            }
            else
            {
                UpdateDataGroupRequest request = new UpdateDataGroupRequest();
                request.Group = group;
                UpdateDataGroupResponse response = _groupService.UpdateDataGroup(request);

                return(Json(response.Messages.ToList(), JsonRequestBehavior.AllowGet));
            }
        }