Exemple #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;
        }
        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();
            }
        }
Exemple #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();
        }
        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;
                }
            }
        }
Exemple #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);
        }
Exemple #6
0
 private void FillGrid()
 {
     ContextManager manager = new ContextManager();
     SecurityRolesLogic sr = new SecurityRolesLogic(manager);
     RolesGV.DataSource = sr.GetAll();
     manager.CloseContext();
 }
Exemple #7
0
 public TeamsList(int _StructureObjectId)
 {
     InitializeComponent();
     manager = new ContextManager();
     DataGV.AutoGenerateColumns = false;
     StructureObjectId = _StructureObjectId;
     Fill();
 }
Exemple #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();
 }
 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();
 }
 public EmployeePositionsList(int _employeeId)
 {
     InitializeComponent();
     manager = new ContextManager();
     DataGV.AutoGenerateColumns = false;
     employeeId = _employeeId;
     Fill();
 }
Exemple #11
0
 public WareMinQuantity(int WareID)
 {
     InitializeComponent();
     manager = new ContextManager();
     context = manager.Context;
     wareId = WareID;
     Fill();
 }
Exemple #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();
 }
Exemple #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();
 }
Exemple #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();
 }
Exemple #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();
 }
Exemple #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();
 }
Exemple #18
0
 private void CalculateSalarySB_Click(object sender, EventArgs e)
 {
     EmployeeSalaryRecalculate form = new EmployeeSalaryRecalculate();
     form.ShowDialog();
     manager.Save();
     manager.CloseContext();
     manager = new ContextManager();
     Fill();
 }
Exemple #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();
 }
Exemple #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);
 }
Exemple #21
0
 public WareData(string _mode, int? _id, int? _defaultCategoryId)
 {
     InitializeComponent();
     SecondaryQuantityNUD.Text = "";
     manager = new ContextManager();
     mode = _mode;
     defaultCategoryId = _defaultCategoryId;
     id = _id;
     Fill();
 }
Exemple #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();
        }
Exemple #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);
     }
 }
Exemple #24
0
        public PriceData(string _mode, int? _id, int? _wareId)
        {
            InitializeComponent();
            manager = new ContextManager();
            mode = _mode;

            id = _id;
            wareId = _wareId;
            wareFilterUC1.Fill();
            Fill();
        }
Exemple #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();
        }
Exemple #26
0
 public EmployeSalariesList(int? _employeeId)
 {
     InitializeComponent();
     manager = new ContextManager();
     DataGV.AutoGenerateColumns = false;
     employeeId = _employeeId;
     if (_employeeId == null)
     {
         NewSB.Enabled = false;
     }
     Fill();
 }
Exemple #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();
     }
 }
Exemple #28
0
        public EmployeeData(string _mode, int? _id)
        {
            InitializeComponent();
            manager = new ContextManager();
            mode = _mode;
            id = _id;
            FillStructureObjects();
            if (mode == "edit")
            {

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

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

            id = _id;

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

            id = _id;

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