Exemple #1
0
 /// <summary>
 /// Fills the grade.
 /// </summary>
 private void FillGrade()
 {
     /**
      * cboFromGrade.Items.Clear();
      * cboToGrade.Items.Clear();
      *
      * string query = "SELECT DISTINCT SmartTagValue FROM MemberSmartTag WHERE TagId IN (SELECT TagId FROM SmartTag4Member WHERE TagCode = 'Grade' AND Priority = 1) ORDER BY SmartTagValue";
      * SqlCommand cmd = new SqlCommand();
      * cmd.CommandText = query;
      * cmd.CommandTimeout = 600;
      * cmd.CommandType = CommandType.Text;
      *
      * using (SqlDataReader reader = SqlHelper.Default.ExecuteReader(cmd))
      * {
      *  while (reader.Read())
      *  {
      *      cboFromGrade.Items.Add(reader.GetString(0));
      *      cboToGrade.Items.Add(reader.GetString(0));
      *  }
      * }
      * if (cboFromGrade.Items.Count > 0)
      * {
      *  cboFromGrade.SelectedIndex = 0;
      *  cboToGrade.SelectedIndex = 0;
      * }
      */
     SmartTag4Member_OptionsEx.FillSmartTagComboBox(ref cboFromGrade, 1);
     SmartTag4Member_OptionsEx.FillSmartTagComboBox(ref cboToGrade, 1);
 }
        private void FillComboBox_Nature()
        {
            var id         = SmartTag4MemberEx.GetIdByPriority(99); // member nature
            var textFields = new string[] { "OptionCode", "OptionName" };
            var pattern    = "{0} - {1}";

            var where = string.Format("TagId = '{0}'", id.ToString());
            var orderBy = new string[] { "OptionCode" };

            SmartTag4Member_OptionsEx.LoadCombo(ref cboNature, textFields, pattern, true, true, "", where, orderBy);
        }
Exemple #3
0
        private void FillComboList()
        {
            FillSalutationList();
            FillJobTitleList();
            FillMemberClass();
            FillMemberGroupList();
            FillWorkplace();

            SmartTag4Member_OptionsEx.FillSmartTagComboBox(ref cboSmartTag1, 1);
            SmartTag4Member_OptionsEx.FillSmartTagComboBox(ref cboSmartTag2, 2);
            SmartTag4Member_OptionsEx.FillSmartTagComboBox(ref cboSmartTag3, 3);
            SmartTag4Member_OptionsEx.FillSmartTagComboBox(ref cboSmartTag4, 4);
            SmartTag4Member_OptionsEx.FillSmartTagComboBox(ref cboSmartTag11, 11);
        }
Exemple #4
0
        private void smartDialog_Closed(object sender, FormClosedEventArgs e)
        {
            var dialog   = (SmartTag4Member_OptionsWizard)sender;
            var smartTag = SmartTag4MemberEx.Get(dialog.SmartTagId);

            switch (smartTag.Priority)
            {
            case 1:
                SmartTag4Member_OptionsEx.FillSmartTagComboBox(ref cboSmartTag1, 1);
                break;

            case 2:
                SmartTag4Member_OptionsEx.FillSmartTagComboBox(ref cboSmartTag2, 2);
                break;

            case 3:
                SmartTag4Member_OptionsEx.FillSmartTagComboBox(ref cboSmartTag3, 3);
                break;

            case 4:
                SmartTag4Member_OptionsEx.FillSmartTagComboBox(ref cboSmartTag4, 4);
                break;
            }
        }
        private bool IsValid()
        {
            bool result = true;

            #region Tag Code 唔可以吉
            errorProvider.SetError(txtOptionCode, string.Empty);
            if (txtOptionCode.Text.Length == 0)
            {
                errorProvider.SetError(txtOptionCode, "Cannot be blank!");
                return(false);
            }
            #endregion

            #region 新增,要 check Tag Code 係咪 in use
            errorProvider.SetError(txtOptionCode, string.Empty);
            if (_OptionId == Guid.Empty && SmartTag4Member_OptionsEx.IsTagCodeInUse(_SmartTagId, txtOptionCode.Text.Trim()))
            {
                errorProvider.SetError(txtOptionCode, "Option Code in use");
                return(false);
            }
            #endregion

            return(result);
        }