コード例 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("TypeCode,TypeName,TypeDec,Id,IsDelete,Remark,AddUser,AddTime,EditUser,EditTime")] SalaryType salaryType)
        {
            if (id != salaryType.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(salaryType);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SalaryTypeExists(salaryType.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(salaryType));
        }
コード例 #2
0
        /// <summary>
        /// maaş tipine göre kullanılacak arayüzü bulur
        /// </summary>
        /// <param name="salaryType"></param>
        /// <returns></returns>
        public ICalculatorService GetCalculatorService(SalaryType salaryType)
        {
            switch (salaryType)
            {
            case SalaryType.Fixed:
                _calculatorService = new FixedCalculator();
                break;

            case SalaryType.Daily:
                _calculatorService = new DailyCalculator();
                break;

            case SalaryType.FixedPlusOvertime:
                _overtimeCalculator       = new OvertimeCalculator();
                _calculatorServiceForPlus = new FixedCalculator();
                _calculatorService        = new SalaryPlusOvertimeCalculator(_overtimeCalculator, _calculatorServiceForPlus);
                break;

            case SalaryType.DailyPlusOvertime:
                _overtimeCalculator       = new OvertimeCalculator();
                _calculatorServiceForPlus = new DailyCalculator();
                _calculatorService        = new SalaryPlusOvertimeCalculator(_overtimeCalculator, _calculatorServiceForPlus);
                break;

            default:
                throw new NotImplementedException();
            }
            return(_calculatorService);
        }
コード例 #3
0
        /// <summary>
        /// Changes the Salary of the User
        /// </summary>
        /// <param name="_newSalaryType"></param>
        public void ChangeSalaryType(SalaryType _newSalaryType)
        {
            // set the new value
            SalaryType = _newSalaryType;

            // recalculate the shifts
            ShiftScheduler.Calculate();
        }
コード例 #4
0
        public ISalaryCalculator GetInstance(SalaryType salaryType)
        {
            if (_calculators.ContainsKey(salaryType))
            {
                return(_calculators[salaryType]);
            }

            throw new UnknownSalaryTypeExeption();
        }
コード例 #5
0
 public async Task InsertSalaryDetail(Guid sessionId, SalaryType salaryType, decimal salaryValue)
 {
     await _database.ExecuteAsync("dbo.InsertSalaryDetail", new
     {
         sessionId,
         salaryType = (int) salaryType,
         salaryValue
     });
 }
コード例 #6
0
 public async Task InsertSalaryDetail(Guid sessionId, SalaryType salaryType, decimal salaryValue)
 {
     await _database.ExecuteAsync("dbo.InsertSalaryDetail", new
     {
         sessionId,
         salaryType = (int)salaryType,
         salaryValue
     });
 }
コード例 #7
0
ファイル: User.cs プロジェクト: Namoor/SAESchedule
 public User(string _lastName, string _givenName, string _faculty, string _shiftID, float _maxRevenue, SalaryType _salaryType)
 {
     this.LastName = _lastName;
     this.GivenName = _givenName;
     this.Faculty = _faculty;
     this.ShiftID = _shiftID;
     this.MaxRevenue = _maxRevenue;
     this.SalaryType = _salaryType;
 }
コード例 #8
0
        public async Task <IActionResult> Create([Bind("TypeCode,TypeName,TypeDec,Id,IsDelete,Remark,AddUser,AddTime,EditUser,EditTime")] SalaryType salaryType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(salaryType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(salaryType));
        }
コード例 #9
0
        public static Visibility ToVisibility(this SalaryType type)
        {
            switch (type)
            {
            case SalaryType.Net:
                return(Visibility.Collapsed);

            case SalaryType.Increase:
            case SalaryType.Decrease:
            default:
                return(Visibility.Visible);
            }
        }
コード例 #10
0
        public async Task <IHttpActionResult> ParttimerSalary(KendoDataRequest kendoDataRequest)
        {
            var        year  = Convert.ToInt32(kendoDataRequest.ExternalFilter["Year"]);
            var        month = Convert.ToInt32(kendoDataRequest.ExternalFilter["Month"]);
            SalaryType partTimerSalaryType = (SalaryType)Enum.Parse(typeof(SalaryType), kendoDataRequest.ExternalFilter["SalaryType"].ToString());

            var extraInfo = new Dictionary <string, object>()
            {
                { "SalaryType", partTimerSalaryType },
                { "TotalDaysInMonth", new DateTime(year, month, 1).LastDayOfMonth().Day }
            };

            return(Ok(await kendoDataRequest.GetReport <ParttimerSalaryDetailReportViewModel>(ParttimerSalaryTemplatePath,
                                                                                              ParttimerSalaryPath, extraInfo)));
        }
コード例 #11
0
        public static SolidColorBrush ToForeground(this SalaryType type)
        {
            switch (type)
            {
            case SalaryType.Increase:
                return(new SolidColorBrush(Color.FromRgb(0, 197, 65)));

            case SalaryType.Decrease:
                return(new SolidColorBrush(Color.FromRgb(255, 71, 71)));

            case SalaryType.Net:
                return(new SolidColorBrush(Color.FromRgb(108, 185, 255)));

            default:
                return(new SolidColorBrush(Color.FromRgb(0, 0, 0)));
            }
        }
コード例 #12
0
        public async Task <HttpResponseMessage> ExportParttimerSalary()
        {
            var externalFilterDictionary = JsonConvert.DeserializeObject <Dictionary <string, object> >(HttpContext.Current.Request["ExternalFilter"]);

            var        year  = Convert.ToInt32(externalFilterDictionary["Year"]);
            var        month = Convert.ToInt32(externalFilterDictionary["Month"]);
            SalaryType partTimerSalaryType = (SalaryType)Enum.Parse(typeof(SalaryType), externalFilterDictionary["SalaryType"].ToString());

            var extraInfo = new Dictionary <string, object>()
            {
                { "SalaryType", partTimerSalaryType },
                { "TotalDaysInMonth", new DateTime(year, month, 1).LastDayOfMonth().Day }
            };

            return(await HttpContext.Current.Request.GetExcel <ParttimerSalaryDetailReportViewModel>(
                       ParttimerSalaryTemplatePath,
                       ParttimerSalaryPath, "ParttimerSalary", "Part timer salary", extraInfo));
        }
コード例 #13
0
        public ISalaryCalculator Get(SalaryType type, IDictionary <SalaryType, double> salaries)
        {
            if (!salaries.ContainsKey(SalaryType.HourlySalaryEmployee) || !salaries.ContainsKey(SalaryType.MonthlySalaryEmployee))
            {
                throw new BussinesException("Salary type not supported.");
            }

            switch (type)
            {
            case SalaryType.HourlySalaryEmployee:
                return(new HourlySalaryCalculator(new Salary {
                    Amount = salaries[SalaryType.HourlySalaryEmployee]
                }));

            case SalaryType.MonthlySalaryEmployee:
                return(new MonthlySalaryCalculator(new Salary {
                    Amount = salaries[SalaryType.MonthlySalaryEmployee]
                }));

            default:
                throw new BussinesException("Salary type not supported.");
            }
        }
コード例 #14
0
ファイル: User.cs プロジェクト: Namoor/SAESchedule
        /// <summary>
        /// Changes the Salary of the User
        /// </summary>
        /// <param name="_newSalaryType"></param>
        public void ChangeSalaryType(SalaryType _newSalaryType)
        {
            // set the new value
            SalaryType = _newSalaryType;

            // recalculate the shifts
            ShiftScheduler.Calculate();
        }
コード例 #15
0
 public User(string _lastName, string _givenName, string _faculty, string _shiftID, float _maxRevenue, SalaryType _salaryType)
 {
     this.LastName   = _lastName;
     this.GivenName  = _givenName;
     this.Faculty    = _faculty;
     this.ShiftID    = _shiftID;
     this.MaxRevenue = _maxRevenue;
     this.SalaryType = _salaryType;
 }
 // GET api/SchedulePermanentContractSalaryCalculation
 public PermanentContractSalary Get(decimal salary, SalaryType salaryType, float copyrightLawsPercent = 0)
 {
     return(salaryType == SalaryType.Gross
         ? _calculator.CalculateFromGross(salary, copyrightLawsPercent)
         : _calculator.CalculateFromNett(salary, copyrightLawsPercent));
 }
コード例 #17
0
 public Salarys(double bruttoBedrag = 2440.55, SalaryType typeSalary = SalaryType.Maand, int percent = 21)
 {
     this.Cont         = typeSalary;
     this.BruttoBedrag = bruttoBedrag;
     this.Percent      = percent;
 }
コード例 #18
0
 public SalaryTypeAttribute(SalaryType salaryType)
 {
     SalaryType = salaryType;
 }