Beispiel #1
0
        public async System.Threading.Tasks.Task <ActionResult> Index(string model)
        {
            tb_m_employee trh = new tb_m_employee();

            if (trh != null)
            {
                trh.code = model.Trim();
            }
            TravelRequestHelper trh2 = new TravelRequestHelper();

            trh2.employee_info = trh;
            return(View(trh2));
        }
Beispiel #2
0
        public async Task <ActionResult> Travel2(tb_m_employee model, string a)
        {
            //string Baseurl = "http://localhost:50195/";
            string Baseurl         = "http://10.85.40.68:90/";
            var    ParticipantList = new List <tb_m_employee> {
                //new Participant() { NoregId = "BCA", Name = "Steve",  Age = 21, Amount = 337556412, City = "Malang" }
                new tb_m_employee()
                {
                    bank_account = model.bank_account
                }
            };

            List <tb_m_employee> EmpInfo = new List <tb_m_employee>();

            using (var client = new HttpClient())
            {
                client.DefaultRequestHeaders.Clear();
                //Define request data format
                client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

                //Sending request to find web api REST service resource GetAllEmployees using HttpClient
                HttpResponseMessage Res = await client.GetAsync("api/Employee/tb_m_employee/" + a);

                //Checking the response is successful or not which is sent using HttpClient
                if (Res.IsSuccessStatusCode)
                {
                    //Storing the response details recieved from web api
                    var EmpResponse = Res.Content.ReadAsStringAsync().Result;

                    //Deserializing the response recieved from web api and storing into the Employee list
                    EmpInfo = JsonConvert.DeserializeObject <List <tb_m_employee> >(EmpResponse);
                }
            }

            return(View());
        }
Beispiel #3
0
        public ActionResult Menu(tb_m_employee model)
        {
            ViewBag.Title = model.code;

            return(View(model));
        }