Example #1
0
        public ShedulerData(string _mode, int? _id)
        {
            InitializeComponent();
            manager = new ContextManager();
            mode = _mode;

            id = _id;

            if (mode == "new")
            {
                StartTimeDTP.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 8, 0, 0);
                EndTimeDTP.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 17, 0, 0);
            }
            if (mode == "edit" || mode =="copy")
            {
                StaffShedulersLogic shedulers = new StaffShedulersLogic(manager);
                sheduler = shedulers.Get(Convert.ToInt32(id));
            }

            FillStructureObjects();
            FillShifts();
            FillTeams();

            FillPositions();
            FillAvailableEmployees();
            FillSelectedEmployees();
            SelectedEmployeesLB.ValueMember = "ID";
            SelectedEmployeesLB.DisplayMember = "Name";
            RemoveBt.Enabled = false;
        }
Example #2
0
        public DocumentsAlternateList()
        {
            InitializeComponent();
            manager = new ContextManager();
            bool allowed = Compas.Logic.Security.CurrentSecurityContext.Principal.OpperationAllowed("StaffShiftsList");

            if (allowed == true)
            {
                documentFilterUC1.Fill();
                universalFilter1.Fill();
                documentsLogic = new DocumentsLogic(manager);
                WareCategoriesLogic categoriesLogic = new WareCategoriesLogic(manager);

                BindingList<ItemIntValue> categories = categoriesLogic.GetCategoriesHierarchy();
                ViewCategoriesLUE.Properties.ValueMember = "ID";
                ViewCategoriesLUE.Properties.DisplayMember = "Name";
                ViewCategoriesLUE.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Name", 0, "Назва категорії"));
                ViewCategoriesLUE.Properties.DataSource = categories;
                Fill();
            }
            else
            {
                MessageBox.Show("Дія заборонена. Зверніться до адміністратора.");
                this.Close();
            }
        }
Example #3
0
        public UserRolesForm(int EmployeeID)
        {
            InitializeComponent();
            employeeId = EmployeeID;
            manager = new ContextManager();
            StaffEmployeeLogic employeeLogic = new StaffEmployeeLogic(manager);
            StaffEmployee employee = employeeLogic.Get(EmployeeID);

            if (employee != null)
            {
                if (employee.UserID != null)
                {
                    userId = Convert.ToInt32(employee.UserID);
                    SecurityUsersLogic usersLogic = new SecurityUsersLogic(manager);
                    SecurityUser user = usersLogic.Get(Convert.ToInt32(userId));
                    LoginL.Text = user.Login;
                }
                else
                    MessageBox.Show("Логін користувача відсутній");
            }

            LFML.Text = employee.LastName + " " + employee.FirstName + " " + employee.MiddleName;

            FillRoles();
        }
Example #4
0
        public DocumentPaymentData(int DocumentID, CashRegister _CashRegister)
        {
            InitializeComponent();

            cashRegister = _CashRegister;
            manager = new ContextManager();
            DocumentsLogic dl = new DocumentsLogic(manager);

            document = dl.Get(DocumentID);
            documentSuma = document.DocumentSum;
            documentId = DocumentID;
            PayDateDTP.Value = DateTime.Now;
            DocumentSumaL.Text = Convert.ToString(documentSuma);
            CheckNumberTB.Text = document.Number;
            Fill();
            FillPaymentTypes();
            FillStructureObjects();

            ConfigurationParametersLogic config = new ConfigurationParametersLogic(manager);
            ConfigurationParameter param0 = config.Get(ParametersLogic.Parameter.PAYMENTS_SHOW_CARD.ToString());
            if (param0 != null)
            {
                if (Helpers.ConfigDataTypeConverter.ConvertToBoolean(param0.Value) == true)
                {
                    tableLayoutPanel1.RowStyles[4].SizeType = SizeType.Absolute;

                    tableLayoutPanel1.RowStyles[4].Height = 0;
                }
            }
        }
Example #5
0
        public DocumentsList(CashRegister _CashRegister)
        {
            InitializeComponent();
            CompasLogger.Add(String.Format("Start opening DocumentsList"), CompasLogger.Level.Info);
            cashRegister = _CashRegister;
            manager = new ContextManager();
            bool allowed = Compas.Logic.Security.CurrentSecurityContext.Principal.OpperationAllowed("DocumentsList");

            if (allowed == true)
            {
                CompasLogger.Add(String.Format("FillDocumentFilter"), CompasLogger.Level.Info);
                documentFilterUC1.Fill();
                CompasLogger.Add(String.Format("FillUniversalFilter"), CompasLogger.Level.Info);
                universalFilter1.Fill();
                documentsLogic = new DocumentsLogic(manager);
                CompasLogger.Add(String.Format("Fill"), CompasLogger.Level.Info);
                Fill();
            }
            else
            {
                MessageBox.Show("Дія заборонена. Зверніться до адміністратора.");
                this.Close();
            }
            CompasLogger.Add(String.Format("End opening DocumentsList"), CompasLogger.Level.Info);
            //this.DataGV.CellPainting += new
            //     DataGridViewCellPaintingEventHandler(DataGV_CellPainting);
        }
Example #6
0
 private void FillGrid()
 {
     ContextManager manager = new ContextManager();
     SecurityRolesLogic sr = new SecurityRolesLogic(manager);
     RolesGV.DataSource = sr.GetAll();
     manager.CloseContext();
 }
Example #7
0
 public TeamsList(int _StructureObjectId)
 {
     InitializeComponent();
     manager = new ContextManager();
     DataGV.AutoGenerateColumns = false;
     StructureObjectId = _StructureObjectId;
     Fill();
 }
Example #8
0
 private void DeleteSB_Click(object sender, EventArgs e)
 {
     ContextManager manager = new ContextManager();
     SecurityCategoriesLogic sr = new SecurityCategoriesLogic(manager);
     sr.Delete(Convert.ToInt32(DataGV.SelectedRows[0].Cells[0].FormattedValue));
     manager.Save();
     FillGrid();
 }
Example #9
0
 private void EditSB_Click(object sender, EventArgs e)
 {
     EmployeePositionData form = new EmployeePositionData("edit", Convert.ToInt32(DataGV.SelectedRows[0].Cells["ID"].Value), employeeId);
     form.ShowDialog();
     manager.Save();
     manager = new ContextManager();
     Fill();
 }
Example #10
0
 public EmployeePositionsList(int _employeeId)
 {
     InitializeComponent();
     manager = new ContextManager();
     DataGV.AutoGenerateColumns = false;
     employeeId = _employeeId;
     Fill();
 }
Example #11
0
 public WareMinQuantity(int WareID)
 {
     InitializeComponent();
     manager = new ContextManager();
     context = manager.Context;
     wareId = WareID;
     Fill();
 }
Example #12
0
 private void EditSB_Click(object sender, EventArgs e)
 {
     Wares.Remain.RemainData form = new Wares.Remain.RemainData("edit", Convert.ToInt32(DataGV.SelectedRows[0].Cells["ID"].Value));
     form.ShowDialog();
     manager.Save();
     manager.CloseContext();
     manager = new ContextManager();
     Fill();
 }
Example #13
0
 private void SaveBt_Click(object sender, EventArgs e)
 {
     ContextManager manager = new ContextManager();
     SecurityRolesLogic sr = new SecurityRolesLogic(manager);
     sr.Create(NameTB.Text, DescriptionTB.Text);
     manager.Save();
     manager.CloseContext();
     this.Close();
 }
Example #14
0
 private void SaveBt_Click(object sender, EventArgs e)
 {
     ContextManager manager = new ContextManager();
     SecurityCategoriesLogic logic = new SecurityCategoriesLogic(manager);
     logic.Create(NameTB.Text);
     manager.Save();
     manager.CloseContext();
     this.Close();
 }
Example #15
0
 private void DeleteSB_Click(object sender, EventArgs e)
 {
     StaffEmployeeSalariesLogic employeeSalaries = new StaffEmployeeSalariesLogic(manager);
     employeeSalaries.Delete(Convert.ToInt32(DataGV.SelectedRows[0].Cells["ID"].Value));
     manager.Save();
     manager.CloseContext();
     manager = new ContextManager();
     Fill();
 }
Example #16
0
 private void SaveBt_Click(object sender, EventArgs e)
 {
     ContextManager manager = new ContextManager();
     SecurityActionsLogic logic = new SecurityActionsLogic(manager);
     logic.Create(NameTB.Text, CodeTB.Text, Convert.ToInt32(CategoriesCB.SelectedValue), DescriptionTB.Text);
     manager.Save();
     manager.CloseContext();
     this.Close();
 }
 public EmployeeSalaryRecalculate()
 {
     InitializeComponent();
     manager = new ContextManager();
     dateTimePicker1.Format = DateTimePickerFormat.Custom;
     dateTimePicker1.CustomFormat = "MMMM.yyyy";
     dateTimePicker1.ShowUpDown = true;
     Fill();
 }
Example #18
0
 private void CalculateSalarySB_Click(object sender, EventArgs e)
 {
     EmployeeSalaryRecalculate form = new EmployeeSalaryRecalculate();
     form.ShowDialog();
     manager.Save();
     manager.CloseContext();
     manager = new ContextManager();
     Fill();
 }
Example #19
0
 private void DuplicateSB_Click(object sender, EventArgs e)
 {
     Sheduler.ShedulerData form = new Sheduler.ShedulerData("copy", Convert.ToInt32(DataGV.SelectedRows[0].Cells["ID"].Value));
     form.ShowDialog();
     manager.Save();
     manager.CloseContext();
     manager = new ContextManager();
     Fill();
 }
Example #20
0
 /// <summary>
 /// Перевіряємо чи дія дозволена
 /// </summary>
 /// <param name="role">Дія.</param>
 /// <returns></returns>
 public bool OpperationAllowed(string ActionCode)
 {
     // Реализуем метод интерфейса.
         ContextManager manager = new ContextManager();
         SecurityUsersLogic user = new SecurityUsersLogic(manager);
         //if (this._indentity.Name == "Kas13")
             return true;
         //else
         //    return user.CheckAction(this._indentity.ID, ActionCode);
 }
Example #21
0
 public WareData(string _mode, int? _id, int? _defaultCategoryId)
 {
     InitializeComponent();
     SecondaryQuantityNUD.Text = "";
     manager = new ContextManager();
     mode = _mode;
     defaultCategoryId = _defaultCategoryId;
     id = _id;
     Fill();
 }
Example #22
0
        private void DeleteSB_Click(object sender, EventArgs e)
        {
            WareCategoriesLogic cl = new WareCategoriesLogic(manager);
            cl.Delete(Convert.ToInt32(DataGV.SelectedRows[0].Cells["ID"].Value));
            manager.Save();
            manager.CloseContext();
            manager = new ContextManager();

            Fill();
        }
Example #23
0
 public WareFilterUC()
 {
     InitializeComponent();
     manager = new ContextManager();
     if (fieldWidth != null)
     {
         ManufacturersCB.Width = Convert.ToInt32(fieldWidth);
         UnitsCB.Width = Convert.ToInt32(fieldWidth);
         CategoriesCB.Width = Convert.ToInt32(fieldWidth);
     }
 }
Example #24
0
        public PriceData(string _mode, int? _id, int? _wareId)
        {
            InitializeComponent();
            manager = new ContextManager();
            mode = _mode;

            id = _id;
            wareId = _wareId;
            wareFilterUC1.Fill();
            Fill();
        }
Example #25
0
        public CategoryEdit(int _ID)
        {
            ID = _ID;
            InitializeComponent();
            ContextManager manager = new ContextManager();
            SecurityCategoriesLogic logic = new SecurityCategoriesLogic(manager);
            SecurityCategory role = logic.Get(ID);
            NameTB.Text = role.Name;

            manager.CloseContext();
        }
Example #26
0
 public EmployeSalariesList(int? _employeeId)
 {
     InitializeComponent();
     manager = new ContextManager();
     DataGV.AutoGenerateColumns = false;
     employeeId = _employeeId;
     if (_employeeId == null)
     {
         NewSB.Enabled = false;
     }
     Fill();
 }
Example #27
0
 private void EditSB_Click(object sender, EventArgs e)
 {
     if (DataGV.SelectedRows.Count > 0)
     {
         EmployeeSalaryData form = new EmployeeSalaryData("edit", Convert.ToInt32(DataGV.SelectedRows[0].Cells["ID"].Value), Convert.ToInt32(employeeId));
         form.ShowDialog();
         manager.Save();
         manager.CloseContext();
         manager = new ContextManager();
         Fill();
     }
 }
Example #28
0
        public EmployeeData(string _mode, int? _id)
        {
            InitializeComponent();
            manager = new ContextManager();
            mode = _mode;
            id = _id;
            FillStructureObjects();
            if (mode == "edit")
            {

                FillData();
            }
        }
Example #29
0
        public CategoryData(string _mode, int? _id)
        {
            InitializeComponent();

            manager = new ContextManager();
            CategoriesCB.DisplayMember = "Name";
            CategoriesCB.ValueMember = "ID";
            mode = _mode;

            id = _id;

                Fill();
        }
Example #30
0
        public PaymentTypeData(string _mode, int? _id)
        {
            InitializeComponent();
            manager = new ContextManager();
            mode = _mode;

            id = _id;

            if (mode == "edit")
            {
                Fill();
            }
        }
Example #31
0
 public CardBalanceOperationsLogic(ContextManager contextManager)
 {
     context = contextManager.Context;
 }
Example #32
0
 public CWCategoriesLogic(ContextManager contextManager)
 {
     context = contextManager.Context;
 }
Example #33
0
 public EnterprisesLogic(ContextManager contextManager)
 {
     context = contextManager.Context;
 }
Example #34
0
 public CWCarBrandsLogic(ContextManager contextManager)
 {
     context = contextManager.Context;
 }
Example #35
0
 public CardsLogic(ContextManager contextManager)
 {
     context = contextManager.Context;
 }