コード例 #1
0
        public IActionResult Details(int id)
        {
            var            user           = new PhongBanView();
            var            url            = "https://localhost:44368/api/phongban/get/" + id;
            HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(url);

            httpWebRequest.Method = "GET";
            var response = httpWebRequest.GetResponse();

            {
                string responseData;
                Stream responseStream = response.GetResponseStream();
                try
                {
                    StreamReader streamReader = new StreamReader(responseStream);
                    try
                    {
                        responseData = streamReader.ReadToEnd();
                    }
                    finally
                    {
                        ((IDisposable)streamReader).Dispose();
                    }
                }
                finally
                {
                    ((IDisposable)responseStream)?.Dispose();
                }

                user = JsonConvert.DeserializeObject <PhongBanView>(responseData);
            }
            return(View(user));
        }
コード例 #2
0
ファイル: Index.g.cshtml.cs プロジェクト: ThanhLNP/code-gym
        #pragma warning disable 1998
        public async override global::System.Threading.Tasks.Task ExecuteAsync()
        {
            BeginContext(44, 2, true);
            WriteLiteral("\r\n");
            EndContext();
#line 3 "D:\code-gym\BTQLNV\BTQLNV\Views\NhanVien\Index.cshtml"

            ViewData["Title"] = "Danh sach nhan vien";
            var phongBan = new PhongBanView();
            phongBan = ViewBag.PhongBan;

#line default
#line hidden
            BeginContext(175, 7, true);
            WriteLiteral("\r\n<h1> ");
            EndContext();
            BeginContext(183, 14, false);
#line 9 "D:\code-gym\BTQLNV\BTQLNV\Views\NhanVien\Index.cshtml"
            Write(phongBan.TenPB);

#line default
#line hidden
            EndContext();
            BeginContext(197, 24, true);
            WriteLiteral(" - Danh sach nhan vien (");
            EndContext();
            BeginContext(222, 16, false);
#line 9 "D:\code-gym\BTQLNV\BTQLNV\Views\NhanVien\Index.cshtml"
            Write(phongBan.SoLuong);

#line default
#line hidden
            EndContext();
            BeginContext(238, 19, true);
            WriteLiteral(")</h1>\r\n\r\n<p>\r\n    ");
            EndContext();
            BeginContext(257, 63, false);
            __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "d849137fdda5de8c3ccff448b93b44f8995286775346", async() => {
                BeginContext(306, 10, true);
                WriteLiteral("Create New");
                EndContext();
            }
                                                                        );
            __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
            __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
            __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_0.Value;
            __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
            __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_1.Value;
            __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1);
            await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

            if (!__tagHelperExecutionContext.Output.IsContentModified)
            {
                await __tagHelperExecutionContext.SetOutputContentAsync();
            }
            Write(__tagHelperExecutionContext.Output);
            __tagHelperExecutionContext = __tagHelperScopeManager.End();
            EndContext();
            BeginContext(320, 17, true);
            WriteLiteral("\r\n</p>\r\n<p>\r\n    ");
            EndContext();
            BeginContext(337, 56, false);
            __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "d849137fdda5de8c3ccff448b93b44f8995286776946", async() => {
                BeginContext(385, 4, true);
                WriteLiteral("Back");
                EndContext();
            }
                                                                        );
            __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
            __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
            __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_2.Value;
            __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_2);
            __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_3.Value;
            __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_3);
            await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

            if (!__tagHelperExecutionContext.Output.IsContentModified)
            {
                await __tagHelperExecutionContext.SetOutputContentAsync();
            }
            Write(__tagHelperExecutionContext.Output);
            __tagHelperExecutionContext = __tagHelperScopeManager.End();
            EndContext();
            BeginContext(393, 92, true);
            WriteLiteral("\r\n</p>\r\n<table class=\"table\">\r\n    <thead>\r\n        <tr>\r\n            <th>\r\n                ");
            EndContext();
            BeginContext(486, 38, false);
#line 21 "D:\code-gym\BTQLNV\BTQLNV\Views\NhanVien\Index.cshtml"
            Write(Html.DisplayNameFor(model => model.Ho));

#line default
#line hidden
            EndContext();
            BeginContext(524, 55, true);
            WriteLiteral("\r\n            </th>\r\n            <th>\r\n                ");
            EndContext();
            BeginContext(580, 39, false);
#line 24 "D:\code-gym\BTQLNV\BTQLNV\Views\NhanVien\Index.cshtml"
            Write(Html.DisplayNameFor(model => model.Ten));

#line default
#line hidden
            EndContext();
            BeginContext(619, 55, true);
            WriteLiteral("\r\n            </th>\r\n            <th>\r\n                ");
            EndContext();
            BeginContext(675, 42, false);
#line 27 "D:\code-gym\BTQLNV\BTQLNV\Views\NhanVien\Index.cshtml"
            Write(Html.DisplayNameFor(model => model.DiaChi));

#line default
#line hidden
            EndContext();
            BeginContext(717, 55, true);
            WriteLiteral("\r\n            </th>\r\n            <th>\r\n                ");
            EndContext();
            BeginContext(773, 45, false);
#line 30 "D:\code-gym\BTQLNV\BTQLNV\Views\NhanVien\Index.cshtml"
            Write(Html.DisplayNameFor(model => model.DienThoai));

#line default
#line hidden
            EndContext();
            BeginContext(818, 55, true);
            WriteLiteral("\r\n            </th>\r\n            <th>\r\n                ");
            EndContext();
            BeginContext(874, 41, false);
#line 33 "D:\code-gym\BTQLNV\BTQLNV\Views\NhanVien\Index.cshtml"
            Write(Html.DisplayNameFor(model => model.Email));

#line default
#line hidden
            EndContext();
            BeginContext(915, 86, true);
            WriteLiteral("\r\n            </th>\r\n            <th></th>\r\n        </tr>\r\n    </thead>\r\n    <tbody>\r\n");
            EndContext();
#line 39 "D:\code-gym\BTQLNV\BTQLNV\Views\NhanVien\Index.cshtml"
            foreach (var item in Model)
            {
#line default
#line hidden
                BeginContext(1050, 60, true);
                WriteLiteral("            <tr>\r\n                <td>\r\n                    ");
                EndContext();
                BeginContext(1111, 37, false);
#line 43 "D:\code-gym\BTQLNV\BTQLNV\Views\NhanVien\Index.cshtml"
                Write(Html.DisplayFor(modelItem => item.Ho));

#line default
#line hidden
                EndContext();
                BeginContext(1148, 67, true);
                WriteLiteral("\r\n                </td>\r\n                <td>\r\n                    ");
                EndContext();
                BeginContext(1216, 38, false);
#line 46 "D:\code-gym\BTQLNV\BTQLNV\Views\NhanVien\Index.cshtml"
                Write(Html.DisplayFor(modelItem => item.Ten));

#line default
#line hidden
                EndContext();
                BeginContext(1254, 67, true);
                WriteLiteral("\r\n                </td>\r\n                <td>\r\n                    ");
                EndContext();
                BeginContext(1322, 41, false);
#line 49 "D:\code-gym\BTQLNV\BTQLNV\Views\NhanVien\Index.cshtml"
                Write(Html.DisplayFor(modelItem => item.DiaChi));

#line default
#line hidden
                EndContext();
                BeginContext(1363, 67, true);
                WriteLiteral("\r\n                </td>\r\n                <td>\r\n                    ");
                EndContext();
                BeginContext(1431, 44, false);
#line 52 "D:\code-gym\BTQLNV\BTQLNV\Views\NhanVien\Index.cshtml"
                Write(Html.DisplayFor(modelItem => item.DienThoai));

#line default
#line hidden
                EndContext();
                BeginContext(1475, 67, true);
                WriteLiteral("\r\n                </td>\r\n                <td>\r\n                    ");
                EndContext();
                BeginContext(1543, 40, false);
#line 55 "D:\code-gym\BTQLNV\BTQLNV\Views\NhanVien\Index.cshtml"
                Write(Html.DisplayFor(modelItem => item.Email));

#line default
#line hidden
                EndContext();
                BeginContext(1583, 67, true);
                WriteLiteral("\r\n                </td>\r\n                <td>\r\n                    ");
                EndContext();
                BeginContext(1651, 67, false);
#line 58 "D:\code-gym\BTQLNV\BTQLNV\Views\NhanVien\Index.cshtml"
                Write(Html.ActionLink("Edit", "Edit", "NhanVien", new { id = item.MaNV }));

#line default
#line hidden
                EndContext();
                BeginContext(1718, 24, true);
                WriteLiteral(" |\r\n                    ");
                EndContext();
                BeginContext(1743, 73, false);
#line 59 "D:\code-gym\BTQLNV\BTQLNV\Views\NhanVien\Index.cshtml"
                Write(Html.ActionLink("Details", "Details", "NhanVien", new { id = item.MaNV }));

#line default
#line hidden
                EndContext();
                BeginContext(1816, 24, true);
                WriteLiteral(" |\r\n                    ");
                EndContext();
                BeginContext(1841, 89, false);
#line 60 "D:\code-gym\BTQLNV\BTQLNV\Views\NhanVien\Index.cshtml"
                Write(Html.ActionLink("Delete", "Delete", "NhanVien", new { id = item.MaNV, PBID = item.IDPB }));

#line default
#line hidden
                EndContext();
                BeginContext(1930, 44, true);
                WriteLiteral("\r\n                </td>\r\n            </tr>\r\n");
                EndContext();
#line 63 "D:\code-gym\BTQLNV\BTQLNV\Views\NhanVien\Index.cshtml"
            }

#line default
#line hidden
            BeginContext(1985, 24, true);
            WriteLiteral("    </tbody>\r\n</table>\r\n");
            EndContext();
        }