コード例 #1
0
        public DossierSearchBoxPopup(SearchField searchField)
        {
            InitializeComponent();
            this.ArchiveField              = searchField.Field;
            comboBoxExtendedAndOr.Visible  = searchField.Relation != SearchField.Relations.None;
            comboBoxExtendedAndOr.Location = new Point(lblField.Location.X + lblField.Width + 5, comboBoxExtendedAndOr.Location.Y);
            this.Width = comboBoxExtendedAndOr.Location.X + comboBoxExtendedAndOr.Width + 50;
            if (comboBoxExtendedAndOr.Visible == false)
            {
                this.Width -= comboBoxExtendedAndOr.Width;
            }
            contextMenuStripSelect.Enabled       = false;
            searchMethodBindingSource.DataSource = SearchMethod.GetAllSearchMethods();
            switch (searchField.Relation)
            {
            case SearchField.Relations.None:
                break;

            case SearchField.Relations.And:
                comboBoxExtendedAndOr.SelectedIndex = 0;
                break;

            case SearchField.Relations.Or:
                comboBoxExtendedAndOr.SelectedIndex = 1;
                break;
            }
            comboBoxExtendedMethod.SelectedValue = searchField.Method.Code;
            textBoxExtendedValue.Text            = searchField.Value;
            btnAdd.Text = "ثبت";
        }
コード例 #2
0
ファイル: ReportController.cs プロジェクト: Shiraz-NJIT/Mahba
 private static List <SearchField> LoadSearchFields(Model.Archive.ArchiveDataClassesDataContext dc, Model.Archive.ReportDetail reportDetail, List <SearchField> searchFields)
 {
     foreach (var item in dc.ReportDetails.Where(t => t.ParentID == reportDetail.ID))
     {
         List <SearchField> innerSearchFields = new List <SearchField>();
         LoadSearchFields(dc, item, innerSearchFields);
         searchFields.Add(new SearchField(item.ArchiveField, SearchMethod.GetAllSearchMethods().Where(t => t.Code == item.MethodCode).Single(), item.Value, (SearchField.Relations)item.RelationCode, innerSearchFields));
     }
     return(searchFields);
 }
コード例 #3
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     if (this.DesignMode)
     {
         return;
     }
     this.archiveTabBindingSource.DataSource = Controller.Archive.ArchiveTabController.GetActiveDossierTabs();
     searchMethodBindingSource.DataSource    = SearchMethod.GetAllSearchMethods();
     this.tabControl1.SelectedTab            = tabPage3;
 }
コード例 #4
0
 public DossierSearchBoxPopup(Model.Archive.ArchiveField archiveField, bool allowSelectRelation)
 {
     InitializeComponent();
     this.ArchiveField              = archiveField;
     comboBoxExtendedAndOr.Visible  = allowSelectRelation;
     comboBoxExtendedAndOr.Location = new Point(lblField.Location.X + lblField.Width + 5, comboBoxExtendedAndOr.Location.Y);
     this.Width = comboBoxExtendedAndOr.Location.X + comboBoxExtendedAndOr.Width + 50;
     if (comboBoxExtendedAndOr.Visible == false)
     {
         this.Width -= comboBoxExtendedAndOr.Width;
     }
     contextMenuStripSelect.Enabled       = allowSelectRelation;
     searchMethodBindingSource.DataSource = SearchMethod.GetAllSearchMethods();
 }
コード例 #5
0
ファイル: ReportController.cs プロジェクト: Shiraz-NJIT/Mahba
        internal static IEnumerable <SearchField> LoadReport(int reportID)
        {
            var dc = Model.Archive.ArchiveDataClassesDataContext.GetNewInstance();
            List <SearchField> list = new List <SearchField>();

            foreach (var item in dc.ReportDetails.Where(t => t.ReportID == reportID && t.ParentID == null))
            {
                List <SearchField> searchFields = new List <SearchField>();
                LoadSearchFields(dc, item, searchFields);
                SearchField f = new SearchField(item.ArchiveField, SearchMethod.GetAllSearchMethods().Where(t => t.Code == item.MethodCode).Single(), item.Value, (SearchField.Relations)item.RelationCode, searchFields);
                list.Add(f);
            }
            return(list);
        }