Beispiel #1
0
 public void InsertQa(Qa qa)
 {
     if (qa != null)
     {
         repository.Insert(qa);
     }
 }
Beispiel #2
0
        public ActionResult CreateQa(Qa qa, int advertiseId, int subDomainId)
        {
            qa.AdvertiseId = advertiseId;
            qa.SubDomainId = subDomainId;
            qaService.InsertQa(qa);

            return(RedirectToAction("GetAllQas"));
        }
Beispiel #3
0
 public void UpdateQa(Qa qa)
 {
     try
     {
         repository.Update(qa);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Beispiel #4
0
 public void DeleteQa(Qa qa)
 {
     try
     {
         repository.Delete(qa);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Beispiel #5
0
        public ActionResult SelectQasForeignKeys(SelectQasFKs model)
        {
            Qa qa = new Qa();

            qa.AdvertiseId = model.SelectedAdvertiseId;
            qa.SubDomainId = model.SelectedSubDomainId;

            return(RedirectToAction("CreateQa", new
            {
                qa.AdvertiseId,
                qa.SubDomainId
            }));
        }
Beispiel #6
0
 public void InsertQa(Qa qa)
 {
     try
     {
         if (qa != null)
         {
             repository.Insert(qa);
         }
     }
     catch (Exception e)
     {
         throw e;
     }
 }
        public ActionResult DeleteQa(Qa qa)
        {
            Log.Debug($"Deleting {qa.Question}");

            try
            {
                qaService.DeleteQa(qa);
                Log.Info($"{qa.Question} was deleted succesfully");
            }
            catch (Exception e)
            {
                Log.Error(e.ToString());
            }
            return(RedirectToAction("Qas"));
        }
        public ActionResult CreateQa(Qa qa, int domainId, int subDomainId)
        {
            qa.DomainId    = domainId;
            qa.SubDomainId = subDomainId;

            Log.Debug("Creating new Q&A");
            try
            {
                qaService.InsertQa(qa);
            }
            catch (Exception e)
            {
                Log.Error(e.ToString());
            }

            return(RedirectToAction("Qas"));
        }
        public ActionResult EditQa(Qa qa)
        {
            Log.Debug($"Updating {qa.Question}");
            if (ModelState.IsValid)
            {
                try
                {
                    qaService.UpdateQa(qa);
                    Log.Info($"{qa.Question} was updated succesfully");
                }
                catch (Exception e)
                {
                    Log.Error(e.ToString());
                }
            }

            return(RedirectToAction("Qas"));
        }
        public ActionResult SelectQasForeignKeys(SelectQasFKs model)
        {
            Qa qa = new Qa();

            try
            {
                qa.DomainId    = model.SelectedDomainId;
                qa.SubDomainId = model.SelectedSubDomainId;
            }
            catch (Exception e)
            {
                Log.Error(e.ToString());
            }

            return(RedirectToAction("CreateQa", new
            {
                qa.DomainId,
                qa.SubDomainId
            }));
        }
Beispiel #11
0
 public ActionResult DeleteQa(Qa qa)
 {
     qaService.DeleteQa(qa);
     return(RedirectToAction("GetAllQas"));
 }
Beispiel #12
0
 public ActionResult EditQa(Qa qa)
 {
     qaService.UpdateQa(qa);
     return(RedirectToAction("GetAllQas"));
 }
Beispiel #13
0
 public void UpdateQa(Qa qa)
 {
     repository.Update(qa);
 }
Beispiel #14
0
 public void DeleteQa(Qa qa)
 {
     repository.Delete(qa);
 }