Exemple #1
0
        private EntryControl.Classes.Permit CreateNewPermit()
        {
            Permit permit = new Permit();

            permit.Creator = EntryControlDatabase.EntryPointUser;

            permit.Period       = DateTime.Today.Year;
            permit.PermitState  = new EnumerationItem(1, "временный");
            permit.DateFrom     = DateTime.Today;
            permit.DateTo       = DateTime.Today.AddDays(1);
            permit.DocNumber    = Permit.GetPermitNumber(Database, permit.Period);
            permit.Cargo        = EntryControlDatabase.WoodCargo;
            permit.IsMultiEntry = false;

            List <PermitPoint> pointList = permit.GetPointList(Database);
            int currentPointId           = Settings.Default.EntryPoint;

            EntryControl.Classes.EntryPoint currentPoint = EntryControl.Classes.EntryPoint.Load(Database, currentPointId);
            permit.Comment = "Создан на проходной " + currentPoint.ToString() + Environment.NewLine + "Объем л/мат: ";

            foreach (PermitPoint item in pointList)
            {
                if (item.Point.Id == currentPointId)
                {
                    item.IsAllowed = true;
                }
            }

            return(permit);
        }
        public PermitItemControl(EntryControlDatabase database, Permit permit, EntryControl.Classes.EntryPoint entryPoint)
            : this()
        {
            Database   = database;
            Permit     = permit;
            EntryPoint = entryPoint;


            ShowLabelTexts();
        }
Exemple #3
0
        public StartForm()
        {
            InitializeComponent();

            btnClear.Image = EntryControl.Resources.Images.Failed;

            database = InitializeDatabase();

            entryPoint = InitializeEntryPoint();

            Text = entryPoint.ToString();
        }
Exemple #4
0
        private void SaveSettings()
        {
            Settings.Default.Server = cboxServer.Text;
            Settings.Default.Path   = tboxPath.Text;

            if (cboxEntryPoint.Visible)
            {
                EntryControl.Classes.EntryPoint point = (EntryControl.Classes.EntryPoint)cboxEntryPoint.SelectedItem;
                Settings.Default.EntryPoint = point.Id;
            }

            Settings.Default.Save();
        }
Exemple #5
0
 private void StartForm_KeyDown(object sender, KeyEventArgs e)
 {
     switch (e.KeyCode)
     {
     case Keys.F1:
         if (e.Control)
         {
             ShowInitializeForm();
             database   = InitializeDatabase();
             entryPoint = InitializeEntryPoint();
         }
         break;
     }
 }
Exemple #6
0
 public static List <Permit> LoadList(Database database, DateTime dateStart, DateTime dateFinish,
                                      EntryPoint entryPoint, EnumerationItem defaultState)
 {
     return(LoadList(database, dateStart, dateFinish, entryPoint, defaultState, 1));
 }
Exemple #7
0
 public static List <Permit> LoadList(Database database, DateTime dateStart, DateTime dateFinish,
                                      EntryPoint entryPoint)
 {
     return(LoadList(database, dateStart, dateFinish, entryPoint, new EnumerationItem(0, "")));
 }