Ejemplo n.º 1
0
 public void Insert(WebFacultyService.FacultyDto facultyDto)
 {
     WebFacultyService.InsertRequest inValue = new WebFacultyService.InsertRequest();
     inValue.Body            = new WebFacultyService.InsertRequestBody();
     inValue.Body.facultyDto = facultyDto;
     WebFacultyService.InsertResponse retVal = ((WebFacultyService.WebFacultyServiceSoap)(this)).Insert(inValue);
 }
Ejemplo n.º 2
0
        // GET: Faculty/Details/5
        public ActionResult Details(short id)
        {
            //ViewData["Person"] = _localizer["Person"];
            //ViewData["Edit"] = _localizer["Edit"];
            //ViewData["Details"] = _localizer["Details"];
            //ViewData["BackToList"] = _localizer["BackToList"];

            WebFacultyService.FacultyDto facultyDto = null;
            try
            {
                var url = _iconfiguration.GetValue <string>("WebServices:Faculty:WebFacultyService");
                WebFacultyService.WebFacultyServiceSoapClient soapClient = new WebFacultyService.WebFacultyServiceSoapClient(new BasicHttpBinding(BasicHttpSecurityMode.None), new EndpointAddress(url));
                facultyDto = soapClient.GetId(id);
            }
            catch (System.Net.Http.HttpRequestException ex)
            {
                _logger.LogCritical(ex.Message);
                _logger.LogCritical(ex.StackTrace);
            }
            catch (Exception ex)
            {
                _logger.LogCritical(ex.Message);
                _logger.LogCritical(ex.StackTrace);
            }

            FacultyModel facultyModel = new FacultyModel()
            {
                FacultyId = facultyDto.FacultyId,
                Deleted   = facultyDto.Deleted,
                Name      = facultyDto.Name,
            };

            return(View(facultyModel));
        }
Ejemplo n.º 3
0
        public ActionResult Edit(short id, FacultyModel facultyModel)
        {
            try
            {
                var url = _iconfiguration.GetValue <string>("WebServices:Faculty:WebFacultyService");
                // TODO: Add update logic here
                WebFacultyService.WebFacultyServiceSoapClient soapClient = new WebFacultyService.WebFacultyServiceSoapClient(new BasicHttpBinding(BasicHttpSecurityMode.None), new EndpointAddress(url));
                // TODO: Add insert logic here
                WebFacultyService.FacultyDto faculty = new WebFacultyService.FacultyDto()
                {
                    FacultyId = facultyModel.FacultyId,
                    Deleted   = facultyModel.Deleted,
                    Name      = facultyModel.Name,
                };
                soapClient.Update(faculty);

                return(RedirectToAction(nameof(Index)));
            }
            catch (System.Net.Http.HttpRequestException ex)
            {
                _logger.LogCritical(ex.Message);
                _logger.LogCritical(ex.StackTrace);
                return(View());
            }
            catch (Exception ex)
            {
                _logger.LogCritical(ex.Message);
                _logger.LogCritical(ex.StackTrace);
                return(View());
            }
        }
Ejemplo n.º 4
0
        // GET: Faculty/Edit/5
        public ActionResult Edit(short id)
        {
            //ViewData["Edit"] = _localizer["Edit"];
            //ViewData["Person"] = _localizer["Person"];
            //ViewData["Save"] = _localizer["Save"];
            //ViewData["BackToList"] = _localizer["BackToList"];

            FacultyController facultyController = new FacultyController(logger, _iconfiguration);

            WebFacultyService.FacultyDto facultyDto = null;
            try
            {
                ViewBag.ListFaculty = new Microsoft.AspNetCore.Mvc.Rendering.SelectList(
                    (
                        from faculty in facultyController.FacultyModel
                        select new SelectListItem
                {
                    Text = faculty.Name,
                    Value = faculty.FacultyId.ToString()
                }
                    )
                    , "Value", "Text");

                var url = _iconfiguration.GetValue <string>("WebServices:Faculty:WebFacultyService");
                WebFacultyService.WebFacultyServiceSoapClient soapClient = new WebFacultyService.WebFacultyServiceSoapClient(new BasicHttpBinding(BasicHttpSecurityMode.None), new EndpointAddress(url));
                facultyDto = soapClient.GetId(id);
            }
            catch (System.Net.Http.HttpRequestException ex)
            {
                _logger.LogCritical(ex.Message);
                _logger.LogCritical(ex.StackTrace);
            }
            catch (Exception ex)
            {
                _logger.LogCritical(ex.Message);
                _logger.LogCritical(ex.StackTrace);
            }

            FacultyModel facultyModel = new FacultyModel()
            {
                FacultyId = facultyDto.FacultyId,
                Deleted   = facultyDto.Deleted,
                Name      = facultyDto.Name
            };

            return(View(facultyModel));
        }
Ejemplo n.º 5
0
 public System.Threading.Tasks.Task <WebFacultyService.UpdateResponse> UpdateAsync(WebFacultyService.FacultyDto facultyDto)
 {
     WebFacultyService.UpdateRequest inValue = new WebFacultyService.UpdateRequest();
     inValue.Body            = new WebFacultyService.UpdateRequestBody();
     inValue.Body.facultyDto = facultyDto;
     return(((WebFacultyService.WebFacultyServiceSoap)(this)).UpdateAsync(inValue));
 }
Ejemplo n.º 6
0
 public GetResponseBody(WebFacultyService.FacultyDto GetResult)
 {
     this.GetResult = GetResult;
 }
Ejemplo n.º 7
0
 public UpdateRequestBody(WebFacultyService.FacultyDto facultyDto)
 {
     this.facultyDto = facultyDto;
 }
Ejemplo n.º 8
0
 public InsertRequestBody(WebFacultyService.FacultyDto facultyDto)
 {
     this.facultyDto = facultyDto;
 }