Пример #1
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();
 }
Пример #2
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();
 }
Пример #3
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();
 }
Пример #4
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();
 }
Пример #5
0
        private void SaveBt_Click(object sender, EventArgs e)
        {
            ContextManager manager = new ContextManager();
            StaffTeamsLogic teams = new StaffTeamsLogic(manager);
            if (mode == "new")
            {
                teams.Create(NameTB.Text, StructureObjectId);
            }
            if (mode == "edit")
            {
                teams.Update(Convert.ToInt32(id), NameTB.Text, StructureObjectId);
            }
            manager.Save();

            this.Close();
        }
Пример #6
0
 private void DataGV_DoubleClick_1(object sender, EventArgs e)
 {
     DocumentData form = new DocumentData("edit", Convert.ToInt32(DataGV.SelectedRows[0].Cells["ID"].Value), cashRegister);
     form.ShowDialog();
     manager.Save();
     manager.CloseContext();
     manager = new ContextManager();
     documentsLogic = new DocumentsLogic(manager);
     manager.Save();
     manager.CloseContext();
     manager = new ContextManager();
     Fill();
 }
Пример #7
0
        private void SaveBt_Click(object sender, EventArgs e)
        {
            ContextManager manager = new ContextManager();
            StaffEmployeeSalariesLogic employeeSalaries = new StaffEmployeeSalariesLogic(manager);
            DateTime month = new DateTime(dateTimePicker1.Value.Year, dateTimePicker1.Value.Month, 1, 0, 0, 0);

            int? StructureObjectId= null;

            if (StructureObjectsCB.SelectedIndex >= 0)
            {
                StructureObjectId = Convert.ToInt32(((Item)(StructureObjectsCB.SelectedItem)).ID);
            }

            decimal sumSale = SaleSumNUD.Value;
            decimal extraPercent = ExtraPercentNUD.Value;
            decimal salary = SalaryNUD.Value;
            decimal sumSalary = SaleSumNUD.Value;

            if (mode == "new")
            {
                employeeSalaries.Create(month, Convert.ToInt32(StructureObjectId), Convert.ToInt32(employeeId), sumSale, extraPercent, salary);

            }
            if (mode == "edit")
            {
                employeeSalaries.Update(Convert.ToInt32(id), month, Convert.ToInt32(StructureObjectId), sumSale, extraPercent, salary);
            }
            manager.Save();

            this.Close();
        }
Пример #8
0
        private void SaveBt_Click(object sender, EventArgs e)
        {
            ContextManager manager = new ContextManager();
            StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);
            int? parentStructureObjectID = null;
            if ((StructureObjectsCB.SelectedValue != null) & (StructureObjectsCB.SelectedIndex > 0))
            {
                int test;
                if (int.TryParse(StructureObjectsCB.SelectedValue.ToString(), out test) == true)
                    parentStructureObjectID = Convert.ToInt32(StructureObjectsCB.SelectedValue);
            }

            if (mode == "new")
            {
                StructureObjects.Create(NameTB.Text, AllowServicesCB.Checked, ActiveCB.Checked, parentStructureObjectID);
            }
            if (mode == "edit")
            {
                StructureObjects.Update(Convert.ToInt32(id), NameTB.Text, AllowServicesCB.Checked, ActiveCB.Checked, parentStructureObjectID);
            }
            manager.Save();

            this.Close();
        }
Пример #9
0
        private void MainMDI_Load(object sender, EventArgs e)
        {
            //Початковий запуск - перевіряємо чи заповнений довідник типівдокументів
            ContextManager manager = new ContextManager();
            CompasDataContext context = manager.Context;
            DocumentTypesLogic documentTypes = new DocumentTypesLogic(manager);
            var existTypes = documentTypes.GetAll();
            if (existTypes.Count == 0)
            {
                documentTypes.Create(1, "Прихідна накладна", true, false);
                documentTypes.Create(2, "Розхідна накладна", false, true);
                documentTypes.Create(3, "Чек", false, true);
                documentTypes.Create(4, "Переміщення товару", false, false);
                documentTypes.Create(5, "Замовлення", false, false);
                manager.Save();
            }

            ConfigurationParametersLogic config = new ConfigurationParametersLogic(manager);
            ConfigurationParameter param0 = config.Get(ParametersLogic.Parameter.MENUITEM_CARDS_VISIBLE.ToString());
            if (param0 != null)
            {
                if (param0.Value == "FALSE")
                {
                    foreach (ToolStripMenuItem mainMenu in menuStrip.Items)
                    {
                        if (mainMenu.Text == @"Довідники")
                        {
                            foreach (ToolStripItem subMenu in mainMenu.DropDownItems)
                            {
                                if (subMenu.Name == "CardsToolStripMenuItem")
                                    subMenu.Visible = false;
                            }
                        }
                    }
                }
            }

            ConfigurationParameter param1 = config.Get(ParametersLogic.Parameter.MENUITEM_CARWASH_VISIBLE.ToString());
            if (param1 != null)
            {
                if (param1.Value == "FALSE")
                {
                    foreach (ToolStripMenuItem mainMenu in menuStrip.Items)
                    {
                        if (mainMenu.Text == @"Довідники")
                        {
                            foreach (ToolStripItem subMenu in mainMenu.DropDownItems)
                            {
                                if (subMenu.Name == "CarWashToolStripMenuItem")
                                    subMenu.Visible = false;
                            }
                        }
                    }
                }
            }

            ConfigurationParameter param2 = config.Get(ParametersLogic.Parameter.MENUITEM_SECURITY_ENABLED.ToString());
            if (param2 != null)
            {
                if (param2.Value == "FALSE")
                {
                    menuStrip.Items["SecurityToolStripMenuItem"].Enabled = false;
                }
            }
            manager.CloseContext();
        }
Пример #10
0
        private void SaveBt_Click(object sender, EventArgs e)
        {
            ContextManager manager = new ContextManager();
            StaffEmployeePositionsLogic employeePositions = new StaffEmployeePositionsLogic(manager);
            DateTime? endDate = null;
            int? StructureObjectId= null;

            if (StructureObjectsCB.SelectedIndex > 0)
            {
                StructureObjectId = Convert.ToInt32(((Item)(StructureObjectsCB.SelectedItem)).ID);
            }

            if(EndDateDTP.Format == DateTimePickerFormat.Custom)
            {
                endDate = null;
            }
            else
            {
                endDate = EndDateDTP.Value;
            }
            if (mode == "new")
            {

                employeePositions.Create(employeeId, Convert.ToInt32(PositionsCB.SelectedValue), StartDateDTP.Value, endDate, ActiveCB.Checked, StructureObjectId);

            }
            if (mode == "edit")
            {
                employeePositions.Update(Convert.ToInt32(id), Convert.ToInt32(PositionsCB.SelectedValue), StartDateDTP.Value, endDate, ActiveCB.Checked, StructureObjectId);

            }
            manager.Save();

            this.Close();
        }