예제 #1
0
        public ActionResult Create(claim c)
        {
            //debut code khawla
            IUserService service   = new UserService();
            user         u         = service.GetById(User.Identity.GetUserId());
            string       firstName = u.firstName;
            string       lastName  = u.lastName;
            string       email     = u.Email;

            ViewBag.userFirstName = firstName;
            ViewBag.userLastName  = lastName;
            ViewBag.userMail      = email;
            ViewBag.sexe          = u.sexe.ToLower();
            //fin code khawla
            if (ModelState.IsValid)
            {
                var    MyDateTime = DateTime.Today;
                String MyString;
                MyString      = MyDateTime.ToString("yyyy-MM-dd");
                c.editionDate = MyString;
                c.customer_id = User.Identity.GetUserId();
                cls.Add(c);
                return(RedirectToAction("Index"));
            }
            else
            {
                return(View());
            }
        }
예제 #2
0
 // POST: api/authorization
 public IHttpActionResult Post([FromBody] ClaimDTO[] value)
 {
     foreach (var item in value)
     {
         _claimservice.Add(item);
     }
     return(Ok());
 }
예제 #3
0
        public IActionResult Add(UserOperationClaim claim)
        {
            var result = _claimService.Add(claim);

            if (result.Success)
            {
                return(Ok(result));
            }

            return(BadRequest(result));
        }
예제 #4
0
        public ClaimModel registerStudent(Claim studentregd)
        {
            ClaimModel stdregreply = new ClaimModel();

            MyService.Add(studentregd);
            stdregreply.Name        = studentregd.Name;
            stdregreply.Description = studentregd.Description;
            stdregreply.ParentId    = studentregd.ParentId;
            stdregreply.ClaimDate   = DateTime.Today;
            stdregreply.ClaimType   = studentregd.ClaimType;



            return(stdregreply);
        }
예제 #5
0
        public ActionResult Create(ClaimModel claimM, string name)
        {
            DateTime today  = DateTime.Now;
            Claim    claims = new Claim()
            {
                Name        = claimM.Name,
                Description = claimM.Description,
                ClaimDate   = today,
                ParentId    = (int)Session["idu"],
                ClaimType   = claimM.ClaimType,
                status      = "In_progress"
            };

            ClaimsService.Add(claims);
            ClaimsService.Commit();
            bool result2 = false;

            result2 = ClaimsService.SendEmail("*****@*****.**", "You've got a new claim to treat", "<p><h1>Mister Admin you've got a new claim to treat: </h1><br /><b> *** Claim Type : </b></p>" + claims.ClaimType + "<p><b> *** Claim status Status : </b></p>" + claims.status + "<p><b> *** Claim description : </b></p>" + claims.Description + "<p><b> *** Claim Name : </b></p>" + claims.Name + "<p><b> *** Claim Date : </b></p>" + claims.ClaimDate + "<p><h4><a href='https://localhost:44326/Login/Login/Claim/index'>Please Check your claims Here</a></h4></p>");
            return(RedirectToAction("IndexFront"));
        }