コード例 #1
0
        public async Task <IActionResult> PutCurrentSalary(int id, CurrentSalary currentSalary)
        {
            if (id != currentSalary.CurrentSalaryId)
            {
                return(BadRequest());
            }

            _context.Entry(currentSalary).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CurrentSalaryExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
コード例 #2
0
        public async Task <ActionResult <CurrentSalary> > PostCurrentSalary(CurrentSalary currentSalary)
        {
            _context.Salaries.Add(currentSalary);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetCurrentSalary", new { id = currentSalary.CurrentSalaryId }, currentSalary));
        }
コード例 #3
0
        public ActionResult DeleteConfirmed(int id)
        {
            CurrentSalary currentSalary = db.CurrentSalaries.Find(id);

            db.CurrentSalaries.Remove(currentSalary);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #4
0
 public void MergeFrom(ApplicantProfileReply other)
 {
     if (other == null)
     {
         return;
     }
     if (other.Id.Length != 0)
     {
         Id = other.Id;
     }
     if (other.Login.Length != 0)
     {
         Login = other.Login;
     }
     if (other.currentSalary_ != null)
     {
         if (currentSalary_ == null)
         {
             CurrentSalary = new global::CareerCloud.Grpc.Protos.DecimalValue();
         }
         CurrentSalary.MergeFrom(other.CurrentSalary);
     }
     if (other.currentRate_ != null)
     {
         if (currentRate_ == null)
         {
             CurrentRate = new global::CareerCloud.Grpc.Protos.DecimalValue();
         }
         CurrentRate.MergeFrom(other.CurrentRate);
     }
     if (other.Currency.Length != 0)
     {
         Currency = other.Currency;
     }
     if (other.Country.Length != 0)
     {
         Country = other.Country;
     }
     if (other.Province.Length != 0)
     {
         Province = other.Province;
     }
     if (other.Street.Length != 0)
     {
         Street = other.Street;
     }
     if (other.City.Length != 0)
     {
         City = other.City;
     }
     if (other.PostalCode.Length != 0)
     {
         PostalCode = other.PostalCode;
     }
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
コード例 #5
0
 public ActionResult Edit([Bind(Include = "CurrentSalaryId,EmployeeId,BasicSalary,SundaySalary,LPRate,IncentiveRate,IncentiveTarget,WOWBillRate,WOWBillTarget,IsSundayBillable,EffectiveDate,CloseDate,IsEffective")] CurrentSalary currentSalary)
 {
     if (ModelState.IsValid)
     {
         db.Entry(currentSalary).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.EmployeeId = new SelectList(db.Employees, "EmployeeId", "StaffName", currentSalary.EmployeeId);
     return(View(currentSalary));
 }
コード例 #6
0
        // GET: CurrentSalaries/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CurrentSalary currentSalary = db.CurrentSalaries.Find(id);

            if (currentSalary == null)
            {
                return(HttpNotFound());
            }
            return(View(currentSalary));
        }
コード例 #7
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id.Length != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (Login.Length != 0)
            {
                hash ^= Login.GetHashCode();
            }
            if (currentSalary_ != null)
            {
                hash ^= CurrentSalary.GetHashCode();
            }
            if (currentRate_ != null)
            {
                hash ^= CurrentRate.GetHashCode();
            }
            if (Currency.Length != 0)
            {
                hash ^= Currency.GetHashCode();
            }
            if (Country.Length != 0)
            {
                hash ^= Country.GetHashCode();
            }
            if (Province.Length != 0)
            {
                hash ^= Province.GetHashCode();
            }
            if (Street.Length != 0)
            {
                hash ^= Street.GetHashCode();
            }
            if (City.Length != 0)
            {
                hash ^= City.GetHashCode();
            }
            if (PostalCode.Length != 0)
            {
                hash ^= PostalCode.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
コード例 #8
0
        // GET: CurrentSalaries/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CurrentSalary currentSalary = db.CurrentSalaries.Find(id);

            if (currentSalary == null)
            {
                return(HttpNotFound());
            }
            ViewBag.EmployeeId = new SelectList(db.Employees, "EmployeeId", "StaffName", currentSalary.EmployeeId);
            return(View(currentSalary));
        }
コード例 #9
0
ファイル: ImportPayroll.cs プロジェクト: amitdumka/eStore
        private async System.Threading.Tasks.Task AddCurrentSalarAsync(IXLWorksheet ws)
        {
            var nonEmptyDataRows = ws.RowsUsed();
            int Row = 6;//Title;
            List <CurrentSalary> salLst = new List <CurrentSalary>();

            foreach (var dR in nonEmptyDataRows)
            {
                //for row number check
                if (dR.RowNumber() > Row)
                {
                    CurrentSalary sal = new CurrentSalary
                    {
                        CurrentSalaryId  = dR.Cell(1).GetValue <int>(),
                        IsReadOnly       = true,
                        EntryStatus      = 0,
                        BasicSalary      = dR.Cell(3).GetValue <decimal>(),
                        LPRate           = dR.Cell(4).GetValue <decimal>(),
                        IncentiveRate    = dR.Cell(5).GetValue <decimal>(),
                        IncentiveTarget  = dR.Cell(6).GetValue <decimal>(),
                        WOWBillRate      = dR.Cell(7).GetValue <decimal>(),
                        WOWBillTarget    = dR.Cell(8).GetValue <decimal>(),
                        IsFullMonth      = dR.Cell(9).GetBoolean(),
                        IsSundayBillable = dR.Cell(10).GetBoolean(),
                        EffectiveDate    = dR.Cell(11).GetDateTime().Date,
                        IsEffective      = dR.Cell(13).GetBoolean(),
                        IsTailoring      = dR.Cell(14).GetBoolean(),
                        UserId           = "Admin",
                    };

                    try
                    {
                        sal.EmployeeId = EmpRecord.Where(c => c.OldId == dR.Cell(2).GetValue <int>()).Select(c => c.NewId).FirstOrDefault();
                        sal.CloseDate  = (DateTime?)dR.Cell(12).GetDateTime().Date ?? null;
                    }
                    catch (Exception)
                    {
                    }

                    salLst.Add(sal);
                }
            }
            await db.Salaries.AddRangeAsync(salLst);

            await db.SaveChangesAsync();
        }
コード例 #10
0
        public async Task <IActionResult> Create([Bind("CurrentSalaryId,EmployeeId,BasicSalary,SundaySalary,LPRate,IncentiveRate,IncentiveTarget,WOWBillRate,WOWBillTarget,IsSundayBillable,EffectiveDate,CloseDate,IsEffective")] CurrentSalary currentSalary)
        {
            if (ModelState.IsValid)
            {
                if (currentSalary.IsSundayBillable)
                {
                    var sunsal = currentSalary.BasicSalary / 30;
                    if (currentSalary.SundaySalary != sunsal)
                    {
                        currentSalary.SundaySalary = sunsal;
                    }
                }
                _context.Add(currentSalary);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData ["EmployeeId"] = new SelectList(_context.Employees, "EmployeeId", "StaffName", currentSalary.EmployeeId);
            return(PartialView(currentSalary));
        }
コード例 #11
0
        public async Task <IActionResult> Edit(int id, [Bind("CurrentSalaryId,EmployeeId,BasicSalary,SundaySalary,LPRate,IncentiveRate,IncentiveTarget,WOWBillRate,WOWBillTarget,IsSundayBillable,EffectiveDate,CloseDate,IsEffective")] CurrentSalary currentSalary)
        {
            if (id != currentSalary.CurrentSalaryId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    if (currentSalary.IsSundayBillable)
                    {
                        var sunsal = currentSalary.BasicSalary / 30;
                        if (currentSalary.SundaySalary != sunsal)
                        {
                            currentSalary.SundaySalary = sunsal;
                        }
                    }
                    _context.Update(currentSalary);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CurrentSalaryExists(currentSalary.CurrentSalaryId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData ["EmployeeId"] = new SelectList(_context.Employees, "EmployeeId", "StaffName", currentSalary.EmployeeId);
            return(PartialView(currentSalary));
        }