Exemplo n.º 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);
        }
Exemplo n.º 2
0
        public PermitItemControl(EntryControlDatabase database, Permit permit, EntryControl.Classes.EntryPoint entryPoint)
            : this()
        {
            Database   = database;
            Permit     = permit;
            EntryPoint = entryPoint;


            ShowLabelTexts();
        }
Exemplo n.º 3
0
        public StartForm()
        {
            InitializeComponent();

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

            database = InitializeDatabase();

            entryPoint = InitializeEntryPoint();

            Text = entryPoint.ToString();
        }
Exemplo n.º 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();
        }
Exemplo n.º 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;
     }
 }
Exemplo n.º 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));
 }
Exemplo n.º 7
0
 public static List <Permit> LoadList(Database database, DateTime dateStart, DateTime dateFinish,
                                      EntryPoint entryPoint)
 {
     return(LoadList(database, dateStart, dateFinish, entryPoint, new EnumerationItem(0, "")));
 }