Esempio n. 1
0
        public AddTopic()
        {
            InitializeComponent();

            button1.BackColor = Color.FromArgb(255, 80, 151, 228);
            button2.BackColor = Color.FromArgb(255, 80, 151, 228);
            addDetail.BackColor = Color.FromArgb(255, 80, 151, 228);
            delDetail.BackColor = Color.FromArgb(255, 80, 151, 228);

            button1.ForeColor = Color.White;
            button2.ForeColor = Color.White;
            addDetail.ForeColor = Color.White;
            delDetail.ForeColor = Color.White;

            if (agreementService == null)
            {
                agreementService = AgreementService.getInstance();
            }
            if (strWheres == null)
            {
                strWheres = new Dictionary<string, string>();
            }

            topicCategory.Items.Clear();
            topicCategory.DataSource = Bll.getAllCourses().Tables[0];
            topicCategory.DisplayMember = "TCZ_NAME";
            topicCategory.ValueMember = "TCZ_ID";

            topicType.Items.Clear();
            topicType.DataSource = Constant.getTopicType();
            topicType.DisplayMember = "name";
            topicType.ValueMember = "id";
        }
Esempio n. 2
0
 public static AgreementService getInstance()
 {
     if (instance == null)
     {
         instance = new AgreementService();
     }
     if (agreementDao == null)
     {
         agreementDao = new AgreementDao();
     }
     return instance;
 }
Esempio n. 3
0
 private void loadAgreeMent()
 {
     if (agreementService == null)
     {
         agreementService = AgreementService.getInstance();
     }
     if (strWheres == null)
     {
         strWheres = new Dictionary<string, string>();
     }
     Dictionary<string, AgreeMent> AgreeMents = LoginRoler.AgreeMents;
     AgreeMents.Clear();
     strWheres.Clear();
     DataTable dataTable = agreementService.listAgreements(strWheres).Tables[0];
     for (int i = 0; i < dataTable.Rows.Count; i++)
     {
         AgreeMent agreeMent = new AgreeMent();
         string AgreeMents_str = "";
         for (int j = 0; j < dataTable.Columns.Count; j++)
         {
             if (j == 0)
             {
                 AgreeMents_str = dataTable.Rows[i][j].ToString();
                 agreeMent.Agreement_id = dataTable.Rows[i][j].ToString();
             }
             else if (j == 1)
             {
                 agreeMent.Agreement_name = dataTable.Rows[i][j].ToString();
             }
             else if (j == 2)
             {
                 agreeMent.Agreement_ename = dataTable.Rows[i][j].ToString();
             }
             else if (j == 3)
             {
                 agreeMent.Agreement_type = dataTable.Rows[i][j].ToString();
             }
             else if (j == 4)
             {
                 agreeMent.Agreement = dataTable.Rows[i][j].ToString();
             }
         }
         AgreeMents.Add(AgreeMents_str, agreeMent);
     }
 }