예제 #1
0
        public async Task <IActionResult> Cancel(int id)
        {
            var oldPolicy = await ipoliciesOnEmployeesResponsitory.GetById(id);

            oldPolicy.StatusId = 3;
            ipoliciesOnEmployeesResponsitory.Update(id, oldPolicy);
            return(View("success"));
        }
        public async Task <IActionResult> Accept(int id)
        {
            var oldPolicy = await ipoliciesOnEmployeesResponsitory.GetById(id);

            var policyData = await ipoliciesResponsitory.GetById(oldPolicy.PolicyId);

            if (oldPolicy.StatusId == 1)
            {
                if (policyData.PolicyDuration != null)
                {
                    oldPolicy.EndDate = DateTime.Now.AddDays(Int64.Parse(policyData.PolicyDuration.ToString()));
                }
            }
            oldPolicy.StatusId = 2;
            await ipoliciesOnEmployeesResponsitory.Update(id, oldPolicy);

            return(Json(new[] { new
                                {
                                    data = true
                                } }));
        }