You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
2.5 KiB

4 years ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI.WebControls;
  6. namespace JMEAgentSystem.Library
  7. {
  8. public class StaticDataDdl : SwiftLibrary
  9. {
  10. public void SetStaticDdl(ref DropDownList ddl, string typeId, string valueToBeSelected, string label)
  11. {
  12. SetStaticDdl(ref ddl, typeId, valueToBeSelected, label, "");
  13. }
  14. public void SetStaticDdl(ref DropDownList ddl, string typeId, string valueToBeSelected, string label, string valueId)
  15. {
  16. SetDDL(ref ddl, "EXEC proc_staticDataValue 'c'," + FilterString(typeId) + ",@valueId = " + FilterString(valueId), "valueId", "detailTitle", valueToBeSelected, label);
  17. }
  18. public void SetStaticDdl(ref DropDownList ddl, string typeId)
  19. {
  20. SetStaticDdl(ref ddl, typeId, "", "");
  21. }
  22. public void SetStaticDdl2(ref DropDownList ddl, string typeId, string valueToBeSelected, string label)
  23. {
  24. SetStaticDdl2(ref ddl, typeId, valueToBeSelected, label, "");
  25. }
  26. public void SetStaticDdl2(ref DropDownList ddl, string typeId, string valueToBeSelected, string label, string valueId)
  27. {
  28. SetDDL2(ref ddl, "EXEC proc_staticDataValue 'c'," + FilterString(typeId) + ",@valueId = " + FilterString(valueId), "detailTitle", valueToBeSelected, label);
  29. }
  30. public void SetStaticDdl2(ref DropDownList ddl, string typeId)
  31. {
  32. SetStaticDdl2(ref ddl, typeId, "", "");
  33. }
  34. public void SetStaticDdl3(ref DropDownList ddl, string typeId, string valueToBeSelected, string label)
  35. {
  36. SetStaticDdl3(ref ddl, typeId, valueToBeSelected, label, "");
  37. }
  38. public void SetStaticDdl3(ref DropDownList ddl, string typeId, string valueToBeSelected, string label, string valueId)
  39. {
  40. SetDDL3(ref ddl, "EXEC proc_staticDataValue 'c'," + FilterString(typeId) + ",@valueId = " + FilterString(valueId), "valueId", "detailTitle", valueToBeSelected, label);
  41. }
  42. public void SetStaticDdl3(ref DropDownList ddl, string typeId)
  43. {
  44. SetStaticDdl3(ref ddl, typeId, "", "");
  45. }
  46. public void SelectByTextDdl(ref DropDownList ddl, string text)
  47. {
  48. ListItem li = ddl.Items.FindByText(text);
  49. if (li != null)
  50. {
  51. li.Selected = true;
  52. }
  53. }
  54. }
  55. }