public async Task <ActionResult> DeleteConfirmed(int id)
        {
            ReferralContactModel referralContactModel = await db.ReferralContactModel.FindAsync(id);

            db.ReferralContactModel.Remove(referralContactModel);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
        public async Task <ActionResult> Edit([Bind(Include = "ReferralContactId,ReferralContact")] ReferralContactModel referralContactModel)
        {
            if (ModelState.IsValid)
            {
                db.Entry(referralContactModel).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(referralContactModel));
        }
        public async Task <ActionResult> Create([Bind(Include = "ReferralContactId,ReferralContact")] ReferralContactModel referralContactModel)
        {
            if (ModelState.IsValid)
            {
                db.ReferralContactModel.Add(referralContactModel);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(referralContactModel));
        }
        /// <summary>
        /// Update Referral Contact
        /// </summary>
        /// <param name="referralContact"></param>
        /// <returns></returns>
        public Response <ReferralContactModel> UpdateReferralContact(ReferralContactModel referralContact)
        {
            var referralRepository = unitOfWork.GetRepository <ReferralContactModel>(SchemaName.Registration);
            var procParams         = new List <SqlParameter>
            {
                new SqlParameter("ReferralContactID", referralContact.ReferralContactID),
                new SqlParameter("ReferralID", referralContact.ReferralID),
                new SqlParameter("ContactID", referralContact.ContactID),
                new SqlParameter("ModifiedOn", referralContact.ModifiedOn ?? DateTime.Now)
            };

            return(unitOfWork.EnsureInTransaction(referralRepository.ExecuteNQStoredProc, "usp_UpdateReferralContact", procParams));
        }
        // GET: ReferralContactModels/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ReferralContactModel referralContactModel = await db.ReferralContactModel.FindAsync(id);

            if (referralContactModel == null)
            {
                return(HttpNotFound());
            }
            return(View(referralContactModel));
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Convert ReferralContactModel Model to ReferralContactViewModel ViewModel
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public static ReferralContactViewModel ToViewModel(this ReferralContactModel entity)
        {
            if (entity == null)
            {
                return(null);
            }
            var model = new ReferralViewModel
            {
                ReferralID        = entity.ReferralID,
                ReferralContactID = entity.ReferralContactID,
                ContactID         = entity.ContactID,
                ModifiedOn        = entity.ModifiedOn
            };

            return(model);
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Updates referral contact
 /// </summary>
 /// <param name="referralContact"></param>
 /// <returns></returns>
 public Response <ReferralContactModel> UpdateReferralContact(ReferralContactModel referralContact)
 {
     return(referralService.UpdateReferralContact(referralContact));
 }
Ejemplo n.º 8
0
        /// <summary>
        /// Update referral contact
        /// </summary>
        /// <param name="referralContact"></param>
        /// <returns></returns>
        public Response <ReferralContactModel> UpdateReferralContact(ReferralContactModel referralContact)
        {
            const string apiUrl = BaseRoute + "UpdateReferralContact";

            return(communicationManager.Put <ReferralContactModel, Response <ReferralContactModel> >(referralContact, apiUrl));
        }
Ejemplo n.º 9
0
 public IHttpActionResult UpdateReferralContact(ReferralContactModel referralContact)
 {
     return(new HttpResult <Response <ReferralContactModel> >(referralDataProvider.UpdateReferralContact(referralContact), Request));
 }
Ejemplo n.º 10
0
 public IHttpActionResult UpdateReferralContact(ReferralContactModel referralContact)
 {
     return(new HttpResult <Response <ReferralContactModel> >(referralRuleEngine.UpdateReferralContact(referralContact), Request));
 }