Example #1
0
 public void InitDepartment(DepartmentDesignation des, float timeNorm)
 {
     Init();
     currentTimeRateNorm = timeNorm;
     designation         = des;
     AssignNewCardsPeriodData(new CardsPeriodData(designation, ConverterController.Cost, currentTimeRateNorm));
 }
 private void AddToProcessedRules(IRule rule, DepartmentDesignation designation)
 {
     if (rule.Characteristic.Common) // possibly dangerous if unknown type
     {
         designation = DepartmentsDesignationController.CommonDesignation;
     }
     ESWorkingMemory.DecisionsRules.AddToGroup(designation.value, rule);
 }
    private void ProcessChoiceRules(List <IRule> rules, DepartmentDesignation area)
    {
        DepartmentDesignation ruleDesignation = null;

        foreach (IRule rule in rules)
        {
            ruleDesignation = rule.Characteristic.Common ?
                              DepartmentsDesignationController.CommonDesignation : area;
            ESWorkingMemory.Characteristics.ChangeOrCreate(rule.Characteristic, rule.CharacteristicValue, ruleDesignation.value);
        }
    }
Example #4
0
 void Awake()
 {
     _spentHistory     = new List <int>();
     _allocatedHistory = new List <int>();
     _periodsHistory   = new List <int>();
     _moneyChangedChannel.OnEventRaised += ProcessMoneyChanging;
     _newBudgetChannel.OnEventRaised    += ProcessBudgetAllocation;
     _newPeriodChannel.OnEventRaised    += ProcessNewPeriod;
     _companyDesignation = DepartmentsDesignationController.CommonDesignation;
     ESWorkingMemory.Characteristics.CharacteristicChanged += OnCharacteristicChanged;
     // CharacteristicsManager.AddCharacteristicChangedListener(OnCharacteristicChanged);
     InitDepartmentsIndicators(_departments.GetDepartmentsIndicators());
 }
    public void ProcessChoiceForDepartment(IChoice choice, DepartmentDesignation department)
    {
        bool         paramUpdated = UpdateChoiceParameter(choice);
        List <IRule> choiceRules  = ESKnowledgeBase.DecisionsRulesAnalyzer.GetSatisfiedRulesForChoice(choice);

        ProcessChoiceRules(choiceRules, department);
        if (paramUpdated)
        {
            List <IRule> parameterRules = ESKnowledgeBase.DecisionsRulesAnalyzer.GetSatisfiedRulesForParameter(
                choice.Question.Parameter, choice.ParameterValue);
            parameterRules = FilterRepeatings(parameterRules, choiceRules);
            ProcessParameterRules(parameterRules, department);
        }
    }
Example #6
0
    //***//

    private void Init()
    {
        if (_initialized)
        {
            return;
        }
        _departments = _departments.OrderBy(x => x.OrderNumber).ToList();
        foreach (Department dep in _departments)
        {
            DepartmentDesignation dd = DepartmentsDesignationController.CreateDesignation(dep.OrderNumber);
            dep.InitDepartment(dd, _generalParameters.startDepartmentTimeRateNorm);
        }
        _initialized = true;
    }
Example #7
0
    public void ActivateTaskProcessing(ITaskCard cardData, Department dep)
    {
        _processData            = new TaskProcessData();
        _processData.task       = cardData;
        _processData.department = dep;
        _departmentParameter    = dep.Designation;

        window.Reset();
        window.OnCardSelection += UpdateSelectedSum;
        window.SetProcessData(dep.DepBaseData.fullName, dep.Designation.value,
                              cardData.Task.Data.Name, cardData.Task.Data.Description,
                              cardData.Task.GetNeed());

        Dictionary <CardType, List <ICard> > winRes = new Dictionary <CardType, List <ICard> >();

        foreach (CardType type in window.GetResourcesTypes())
        {
            winRes[type] = dep.GetAvailableResourcesCardsByType(type);
        }
        window.SetResources(winRes);

        window.Active = true;
        ToShowWindow.RaiseEvent(window);
    }
Example #8
0
    private float GetTaskDepartmentCoeff(ITask task, DepartmentDesignation designation)
    {
        List <float> depCoeffs = task.GetDepartmentsCoefficients();

        return(depCoeffs.Count >= designation.value ? depCoeffs[designation.value - 1] : 0f); // to Card method
    }
 public CardsPeriodData(DepartmentDesignation designation, CostController costController, float currentTimeRateNorm)
 {
     _departmentParameter = designation;
     _currentTimeRateNorm = currentTimeRateNorm;
     _costController      = costController;
 }
 /// <summary>
 /// This Function is used to Delete previously added Department Designation from database and is performed by SuperAdmin Only.
 /// </summary>
 public static bool Delete(DepartmentDesignation info)
 {
     return(DepartmentDesignationDA.Delete(info));
 }
 /// <summary>
 /// This Function is used to Update previously added Department Designation in database and is performed by SuperAdmin Only.
 /// </summary>
 public static bool Update(DepartmentDesignation info)
 {
     return(DepartmentDesignationDA.Update(info));
 }
 /// <summary>
 /// This Function is used to add new Department Designation to database and is performed by SuperAdmin Only.
 /// </summary>
 public static bool Add(DepartmentDesignation info)
 {
     return(DepartmentDesignationDA.Add(info));
 }
Example #13
0
 public static bool Delete(DepartmentDesignation info)
 {
     return(BaseDataAccess.ExecuteSQL(String.Format("delete from DepartmentDesignations where Id='{0}' ", info.Id)));
 }
Example #14
0
 public static bool Update(DepartmentDesignation info)
 {
     return(BaseDataAccess.ExecuteSQL(String.Format("update DepartmentDesignations set Name='{0}' where Id='{1}' ", info.Name, info.Id)));
 }
Example #15
0
 public static bool Add(DepartmentDesignation info)
 {
     return(BaseDataAccess.ExecuteSQL(String.Format("insert into DepartmentDesignations(Name) values('{0}') ", info.Name)));
 }