public ActionResult Create(PromotionEventsModel model, string FILTER_Keyword)
        {
            if (ModelState.IsValid)
            {
                if (isExists(null, model.Name))
                {
                    ModelState.AddModelError(PromotionEventsModel.COL_Name.Name, $"{model.Name} sudah terdaftar");
                }
                else
                {
                    model.Id          = Guid.NewGuid();
                    model.Branches_Id = Helper.getActiveBranchId(Session);
                    db.PromotionEvents.Add(model);
                    ActivityLogsController.AddCreateLog(db, Session, model.Id);
                    db.SaveChanges();
                    return(RedirectToAction(nameof(Index), new { id = model.Id, FILTER_Keyword = FILTER_Keyword }));
                }
            }

            setViewBag(FILTER_Keyword);
            return(View(model));
        }
        public ActionResult Edit(PromotionEventsModel modifiedModel, string FILTER_Keyword)
        {
            if (ModelState.IsValid)
            {
                if (isExists(modifiedModel.Id, modifiedModel.Name))
                {
                    ModelState.AddModelError(PromotionEventsModel.COL_Name.Name, $"{modifiedModel.Name} sudah terdaftar");
                }
                else
                {
                    PromotionEventsModel originalModel = db.PromotionEvents.AsNoTracking().Where(x => x.Id == modifiedModel.Id).FirstOrDefault();

                    string log = string.Empty;
                    log = Helper.append <BranchesModel>(log, originalModel.Branches_Id, modifiedModel.Branches_Id, PromotionEventsModel.COL_Branches_Id.LogDisplay);
                    log = Helper.append(log, originalModel.Name, modifiedModel.Name, PromotionEventsModel.COL_Name.LogDisplay);
                    log = Helper.append(log, originalModel.Location, modifiedModel.Location, PromotionEventsModel.COL_Location.LogDisplay);
                    log = Helper.append(log, originalModel.TotalDays, modifiedModel.TotalDays, PromotionEventsModel.COL_TotalDays.LogDisplay);
                    log = Helper.append(log, originalModel.EventFee, modifiedModel.EventFee, PromotionEventsModel.COL_EventFee.LogDisplay);
                    log = Helper.append(log, originalModel.PersonnelCost, modifiedModel.PersonnelCost, PromotionEventsModel.COL_PersonnelCost.LogDisplay);
                    log = Helper.append(log, originalModel.AdditionalCost, modifiedModel.AdditionalCost, PromotionEventsModel.COL_AdditionalCost.LogDisplay);
                    log = Helper.append(log, originalModel.Notes, modifiedModel.Notes, PromotionEventsModel.COL_Notes.LogDisplay);

                    if (!string.IsNullOrEmpty(log))
                    {
                        db.Entry(modifiedModel).State = EntityState.Modified;
                        ActivityLogsController.AddEditLog(db, Session, modifiedModel.Id, log);
                        db.SaveChanges();
                    }

                    return(RedirectToAction(nameof(Index), new { FILTER_Keyword = FILTER_Keyword }));
                }
            }

            setViewBag(FILTER_Keyword);
            return(View(modifiedModel));
        }