예제 #1
0
        private void CategoryChanged()
        {
            this.ShowMessage("");
            myDataSet.RejectChanges();
            data.baseDS.sysCodeCatRow row = categoryCb.GetRow(categoryCb.myValue);
            if (row != null)
            {
                systemChk.Checked  = row.isSystem;
                visibleChk.Checked = row.isVisible;
                maxLenEd.Value     = (row.IsmaxCodeLenNull() ?-1:row.maxCodeLen);
                notesEd.Text       = (row.IsnotesNull() ? "" : row.notes.ToString());
            }
            LoadSyscode();

            if (this.systemChk.Checked)
            {
                LockEdit(true);
            }
            editBtn.Enabled = !this.systemChk.Checked;
        }
예제 #2
0
 protected override bool DataValid(bool showMsg)
 {
     ClearNotifyError();
     if (codeEd.Text.Trim() == "")
     {
         NotifyError(codeLbl);
         this.codeEd.Focus(); return(false);
     }
     if (desc1Ed.Text.Trim() == "")
     {
         NotifyError(desc1Lbl);
         this.desc1Ed.Focus(); return(false);
     }
     data.baseDS.sysCodeCatRow row = categoryCb.GetRow(categoryCb.myValue);
     if (row != null & !row.IsmaxCodeLenNull() && row.maxCodeLen > 0 && codeEd.Text.Length > row.maxCodeLen)
     {
         if (showMsg)
         {
             common.system.ShowErrorMessage(String.Format(Languages.Libs.GetString("dataTooLong"), row.maxCodeLen));
         }
     }
     return(true);
 }