Guest User

Untitled

a guest
Feb 23rd, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. List<UMSLocationDetails> lstUMSLocationDetails = null;
  2.  
  3. string strCurrentGroupName = "";
  4. int intCurrentGroupID = 0;
  5.  
  6. if (!string.IsNullOrEmpty(strUsername))
  7. {
  8. List<UMSGroupDetails> lstUMSGroupDetails = null;
  9. List<UMSLocationDetails> lstUMSLocationDetails = null;
  10.  
  11. ObjUMS.GetUMSGroups(strUsername, out strCurrentGroupName, out intCurrentGroupID, out lstUMSLocationDetails, out lstUMSGroupDetails);
  12. if (strCurrentGroupName != "" && intCurrentGroupID != 0)
  13. {
  14. string LoginUserName = strUsername.ToUpper();
  15. string CurrentGroupName = strCurrentGroupName;
  16. int CurrentGroupID = intCurrentGroupID;
  17. LocationDetails = lstUMSLocationDetails;
  18.  
  19. GetR4GStates(lstUMSLocationDetails);
  20. }
  21. else
  22. {
  23. //error
  24. }
  25. }
  26.  
  27. private void GetR4GStates(string LocationDetails)
  28. {
  29. List<SelectListItem> lstR4GState = new List<SelectListItem>();
  30. try
  31. {
  32. CommonDB ObjCommonDB = new CommonDB();
  33. DataTable dt = ObjCommonDB.GetR4GState(LocationDetails);
  34.  
  35. if (dt.Rows.Count > 0)
  36. {
  37. lstR4GState = (from DataRow dr in dt.Rows
  38. select new SelectListItem()
  39. {
  40. Text = Convert.ToString(dr["R4GSTATENAME"]),
  41. Value = Convert.ToString(dr["R4GSTATECODE"])
  42.  
  43. }).ToList();
  44. }
  45. else
  46. {
  47.  
  48. SelectListItem slEmptyData = new SelectListItem();
  49. slEmptyData.Text = "No Data found";
  50. slEmptyData.Value = "No Data found";
  51. lstR4GState.Add(slEmptyData);
  52.  
  53.  
  54. }
  55. }
  56. catch (Exception)
  57. {
  58.  
  59. throw;
  60. }
  61. }
Add Comment
Please, Sign In to add comment