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)); }
/// <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); }
/// <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(); }
public ISalaryCalculator GetInstance(SalaryType salaryType) { if (_calculators.ContainsKey(salaryType)) { return(_calculators[salaryType]); } throw new UnknownSalaryTypeExeption(); }
public async Task InsertSalaryDetail(Guid sessionId, SalaryType salaryType, decimal salaryValue) { await _database.ExecuteAsync("dbo.InsertSalaryDetail", new { sessionId, salaryType = (int) salaryType, salaryValue }); }
public async Task InsertSalaryDetail(Guid sessionId, SalaryType salaryType, decimal salaryValue) { await _database.ExecuteAsync("dbo.InsertSalaryDetail", new { sessionId, salaryType = (int)salaryType, salaryValue }); }
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; }
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)); }
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); } }
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))); }
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))); } }
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)); }
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."); } }
// 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)); }
public Salarys(double bruttoBedrag = 2440.55, SalaryType typeSalary = SalaryType.Maand, int percent = 21) { this.Cont = typeSalary; this.BruttoBedrag = bruttoBedrag; this.Percent = percent; }
public SalaryTypeAttribute(SalaryType salaryType) { SalaryType = salaryType; }