Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Data.SqlClient;
  5. using System.Linq;
  6. using System.Web;
  7. using System.Web.Configuration;
  8. using System.Web.UI;
  9. using System.Web.UI.WebControls;
  10. using WayneEntity;
  11.  
  12. public partial class CaseMaintain_ChooseUserContractListOP : BasePage
  13. {
  14. protected void Page_Load(object sender, EventArgs e)
  15. {
  16. //base.AllowHttpMethod("POST");
  17.  
  18. int pgNow;
  19. int pgSize;
  20.  
  21. string NameOrIdNo;
  22.  
  23. NameOrIdNo = Request.Form["NameOrIdNo"] ?? "";
  24.  
  25. int.TryParse(Request.Form["pgNow"], out pgNow);
  26. int.TryParse(Request.Form["pgSize"], out pgSize);
  27.  
  28.  
  29.  
  30.  
  31. DataSet ds = new DataSet();
  32.  
  33. using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnDB"].ToString()))
  34. {
  35. using (SqlCommand cmd = new SqlCommand("dbo.usp_CaseUser_xGetConcactList", sc))
  36. {
  37. cmd.CommandType = CommandType.StoredProcedure;
  38. cmd.Parameters.AddWithValue("@pgNow", pgNow == 0 ? 1 : pgNow);
  39. cmd.Parameters.AddWithValue("@pgSize", pgSize == 0 ? 10 : pgSize);
  40. cmd.Parameters.AddWithValue("@NameOrIdNo", NameOrIdNo);
  41.  
  42.  
  43.  
  44. using (SqlDataAdapter da = new SqlDataAdapter(cmd))
  45. {
  46. sc.Open();
  47. da.Fill(ds);
  48. }
  49.  
  50. }
  51. }
  52.  
  53. List<UserProfileListVM> list = new List<UserProfileListVM>();
  54. PageVM rtn = new PageVM();
  55.  
  56. EntityS.FillModel(list, ds.Tables[0]);
  57. EntityS.FillModel(rtn, ds.Tables[1]);
  58. rtn.message = list;
  59.  
  60. Response.ContentType = "application/json; charset=utf-8";
  61. Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(rtn));
  62. Response.End();
  63. }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement