Example #1
0
 private void OnLoad(object sender, EventArgs e)
 {
     if (DesignerDetector.IsComponentInDesignMode(this))
     {
         return;
     }
     // loading doc types
     if (Environment.DocTypeData != null)
     {
         if (Environment.DocTypes != null)
         {
             docTypeParser = new DocTypeParser(Environment.DocTypeData, Environment.DocTypes);
             if (ID > 0)
             {
                 bool parsed = false;
                 text.Text = Environment.DocTypeData.GetDocType(ID, Environment.CurCultureInfo.TwoLetterISOLanguageName);
                 DataRow[] drs = docTypeParser.ParseQuery(text.Text);
                 if (drs != null)
                 {
                     foreach (DataRow t in drs.Where(t => t[Environment.DocTypeData.IDField].Equals(ID)))
                     {
                         SearchType = (byte)t[Environment.DocTypeData.SearchTypeField];
                         Text       = t[Environment.CurCultureInfo.TwoLetterISOLanguageName.Equals("ru") ? Environment.DocTypeData.NameField : Environment.DocTypeData.TypeDocField].ToString();
                         parsed     = true;
                         break;
                     }
                 }
                 if (!parsed)
                 {
                     ID        = 0;
                     text.Text = "";
                 }
             }
         }
         else
         {
             throw new Exception("DocTypeBlock: " +
                                 Environment.StringResources.GetString("DocTypeBlock_OnLoad_Error1"));
         }
     }
     else
     {
         if (!DesignerDetector.IsComponentInDesignMode(this))
         {
             throw new Exception("DocTypeBlock: " +
                                 Environment.StringResources.GetString("DocTypeBlock_OnLoad_Error2") + " (Data).");
         }
     }
 }
Example #2
0
 private void SelectPrintingFormDialog_Load(object sender, EventArgs e)
 {
     buttonOK.Enabled = false;
     types.Columns.Add("DocumentType", types.Width - SystemInformation.VerticalScrollBarWidth,
                       HorizontalAlignment.Left);
     types.FullRowSelect = true;
     lvPrintForms.Columns.Add("DocumentType", lvPrintForms.Width - SystemInformation.VerticalScrollBarWidth,
                              HorizontalAlignment.Left);
     lvPrintForms.FullRowSelect = true;
     dsTypes       = Environment.DocTypeData.GetDocPrintTypes();
     dsPrintForms  = Environment.PrintData.GetPrintForms();
     docTypeParser = new DocTypeParser(Environment.DocTypeData, dsTypes.Tables[0]);
     FillTypes();
     FillPrintForms();
 }
        private void SelectType_Load(object sender, EventArgs e)
        {
            if (dt == null || dt.Rows.Count == 0)
            {
                throw new Exception("SelectTypeDialog: " + Environment.StringResources.GetString("Select_SelectTypeDialog_SelectType_Load_Error1") +
                                    " table.");
            }

            docTypeParser = new DocTypeParser(Environment.DocTypeData, dt);

            types.Columns.Add(Environment.StringResources.GetString("DocumentType"),
                              types.Width - SystemInformation.VerticalScrollBarWidth - 4, HorizontalAlignment.Left);
            subtypes.Columns.Add(Environment.StringResources.GetString("DocumentType"),
                                 subtypes.Width - SystemInformation.VerticalScrollBarWidth - 4, HorizontalAlignment.Left);
            synonyms.Columns.Add(Environment.StringResources.GetString("DocumentType"),
                                 synonyms.Width - SystemInformation.VerticalScrollBarWidth - 4, HorizontalAlignment.Left);
            FillTypes();
            if (pattern != null)
            {
                filter.Text = pattern;
                filter.SelectAll();
            }
        }