Inheritance: UIX.Views.IDecorable, UIX.Views.IValidatable, INull, IObjectState
 public TimeSheetRecord(FactStaff FactStaff, TimeSheet TimeSheet, decimal StaffCount, int daysCount)
 {
     factStaff = FactStaff;
     timeSheet = TimeSheet;
     staffCount = StaffCount;
     timeSheetFSRecord = NullTimeSheetFSWorkingDay.Instance;
     workingDaysCount = daysCount;
 }
Beispiel #2
0
        private void TransferFactStaffBtn_Click(object sender, EventArgs e)
        {
            if (dgvFactStaff.SelectedRows.Count < 1)
               {
               MessageBox.Show("Выберите сотрудников для перевода!");
               return;
               }

               //проверяем, чтобы переводимые еще не были уволены
               foreach (DataGridViewRow selectedRow in dgvFactStaff.SelectedRows)
               {
               //в текущей записи выставляем приказ о переводе и дату перевода
               FactStaff currentFactStaff = (selectedRow.DataBoundItem as FactStaff);
               if (currentFactStaff.Prikaz1 != null)
               {
                   MessageBox.Show("Cотрудник " + currentFactStaff.Employee.ToString() + " уже уволен!");
                   return;
               }
               }

               using (FactStaffTransfer dlg = new FactStaffTransfer())
               {
               dlg.Department = Department;
               dlg.CurentPlanStaff = planStaffBindingSource.Current as Kadr.Data.PlanStaff;
               dlg.ShowDialog();
               //переводим
               try
               {
                   if (dlg.DialogResult == DialogResult.OK)
                   {
                       foreach (DataGridViewRow selectedRow in dgvFactStaff.SelectedRows)
                       {
                           //в текущей записи выставляем приказ о переводе и дату перевода
                           FactStaff currentFactStaff = (selectedRow.DataBoundItem as FactStaff);
                           currentFactStaff.Prikaz1 = dlg.TransferPrikaz;
                           currentFactStaff.DateEnd = dlg.TransferData;

                           //создаем новую запись - с даты перевода и приказом о преводе
                           FactStaff newFactStaff = new FactStaff();
                           newFactStaff.Employee = currentFactStaff.Employee;
                           newFactStaff.WorkType = currentFactStaff.WorkType;
                           newFactStaff.StaffCount = currentFactStaff.StaffCount;
                           newFactStaff.DateBegin = dlg.TransferData;
                           newFactStaff.Prikaz = dlg.TransferPrikaz;
                           newFactStaff.PlanStaff = dlg.NewPlanStaff;

                           //закрепляем, сохраняем новую запись
                           KadrController.Instance.Model.FactStaffs.InsertOnSubmit(newFactStaff);
                           KadrController.Instance.SubmitChanges();

                       }
                   }
               }
               catch (Exception exp)
               {

                   MessageBox.Show(exp.Message, "АИС \"Штатное расписание\"");
                   //KadrController.Instance.DeleteModel();
                   return;
               }
               }
        }
Beispiel #3
0
 public FactStaffHour()
 {
     this.factStaff = new Data.FactStaff();
 }
Beispiel #4
0
 public FactStaffHour(FactStaff factStaff)
 {
     this.factStaff = factStaff;
 }
		private void detach_FactStaffs(FactStaff entity)
		{
			this.SendPropertyChanging();
			entity.PlanStaff = null;
		}
		private void attach_FactStaffs(FactStaff entity)
		{
			this.SendPropertyChanging();
			entity.PlanStaff = this;
		}
 partial void DeleteFactStaff(FactStaff instance);
 public FactStaffHourContract()
 {
     this.factStaff = new Data.FactStaff();
 }
 partial void InsertFactStaff(FactStaff instance);
Beispiel #10
0
		private void attach_FactStaffs(FactStaff entity)
		{
			this.SendPropertyChanging();
			entity.WorkType = this;
		}
Beispiel #11
0
		private void detach_FactStaffs1(FactStaff entity)
		{
			this.SendPropertyChanging();
			entity.Prikaz1 = null;
		}
 public FactStaffHourContractDecorator(FactStaff factStaff)
 {
     this.factStaff = factStaff;
 }
Beispiel #13
0
 public TimeSheetRecord(TimeSheetFSWorkingDay tShRecord)
 {
     factStaff = tShRecord.FactStaff;
     timeSheetFSRecord = tShRecord;
 }
Beispiel #14
0
        private void AddReplacementBtn_Click(object sender, EventArgs e)
        {
            if (factStaffBindingSource.Current == null)
               {
               MessageBox.Show("Выберите сотрудника, которого нужно заместить.", "АИС Штатное расписание", MessageBoxButtons.OK);
               return;
               }

               if ((factStaffBindingSource.Current as FactStaff).Prikaz!=null)
               {
               MessageBox.Show("Совмещаемый сотрудник уже уволен!", "АИС Штатное расписание", MessageBoxButtons.OK);
               return;
               }

               FactStaff currentFactStaff = factStaffBindingSource.Current as FactStaff;

            using (Kadr.UI.Common.PropertyGridDialogAdding<FactStaffReplacement> dlg =
                new Kadr.UI.Common.PropertyGridDialogAdding<FactStaffReplacement>())
            {
                dlg.ObjectList = KadrController.Instance.Model.FactStaffReplacements;
                dlg.BindingSource = null;
                dlg.UseInternalCommandManager = true;
                dlg.InitializeNewObject = (x) =>
                {
                    FactStaff factStaff = new FactStaff();
                    FactStaffHistory fcStHistory = new FactStaffHistory();
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaff, PlanStaff>(factStaff, "PlanStaff", currentFactStaff.PlanStaff, null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaffHistory, WorkType>(fcStHistory, "WorkType", KadrController.Instance.Model.WorkTypes.Where(wtp => wtp.IsReplacement).FirstOrDefault(), null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaff, Employee>(factStaff, "Employee", NullEmployee.Instance, null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaffHistory, Prikaz>(fcStHistory, "Prikaz", NullPrikaz.Instance, null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaff, bool>(factStaff, "IsReplacement", true, null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaffHistory, FactStaff>(fcStHistory, "FactStaff", factStaff, null), this);

                    //вычисляем то кол-во ставок, которое еще не замещено
                    decimal ReplStaffCount = currentFactStaff.StaffCount;
                    foreach (FactStaffReplacement repl in currentFactStaff.FactStaffReplacements)
                    {
                        if (repl.FactStaff1.Prikaz == null)
                            ReplStaffCount -= repl.FactStaff1.StaffCount;
                    }
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaffHistory, decimal>(fcStHistory, "StaffCount", ReplStaffCount, null), this);

                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaffReplacement, FactStaff>(x, "FactStaff1", factStaff, null), this);
                    dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaffReplacement, FactStaff>(x, "FactStaff", currentFactStaff, null), this);
                    if ((dlg.SelectedObjects != null) && (dlg.SelectedObjects.Length == 1))
                    {
                        FactStaffReplacement prev = dlg.SelectedObjects[0] as FactStaffReplacement;
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaffReplacement, FactStaffReplacementReason>(x, "FactStaffReplacementReason", prev.FactStaffReplacementReason, null), this);
                    }
                    else
                    {
                        dlg.CommandManager.Execute(new UIX.Commands.GenericPropertyCommand<FactStaffReplacement, FactStaffReplacementReason>(x, "FactStaffReplacementReason", NullFactStaffReplacementReason.Instance, null), this);
                    }

                };

                dlg.ShowDialog();
            }
            LoadFactStaff();
        }
 public FactStaffDecorator(FactStaff factStaff)
 {
     this.factStaff = factStaff;
 }
Beispiel #16
0
 partial void UpdateFactStaff(FactStaff instance);
 public FactStaffHoursForm(FactStaff FactStaff)
 {
     InitializeComponent();
     factStaff = FactStaff;
 }
 public FactStaffHourContract(FactStaff factStaff)
 {
     this.factStaff = factStaff;
 }