Ejemplo n.º 1
0
        public ActionResult UpdateMasterGoogleType(int googleTypeID)
        {
            ModelManageMasterGoogleType model = new ModelManageMasterGoogleType();

            if (googleTypeID > 0)
            {
                MasterGoogleType _result = _IMasterCategory.Admin_MasterGoogleTypeGet()
                                           .Where(x => x.GoogleTypeID == googleTypeID).FirstOrDefault();
                model.GoogleTypeID   = _result.GoogleTypeID;
                model.TypeName       = _result.TypeName;
                model.ViewTime       = _result.ViewTime;
                model.DisplayForUser = _result.DisplayForUser;
                model.ExtraSearch    = _result.ExtraSearch;
                model.IsNeeded       = _result.IsNeeded;
            }


            return(View(model));
        }
Ejemplo n.º 2
0
        public ActionResult UpdateMasterGoogleType(ModelManageMasterGoogleType model)
        {
            if (_IMasterCategory.Admin_MasterGoogleTypeCheckExists(model.GoogleTypeID, model.TypeName).Count > 0)
            {
                model.ErrorMessage = "Google name already existed";
            }
            else
            {
                MasterGoogleType result = new MasterGoogleType();

                result.ViewTime       = model.ViewTime;
                result.DisplayForUser = model.DisplayForUser;
                result.ExtraSearch    = model.ExtraSearch;
                result.GoogleTypeID   = model.GoogleTypeID;
                result.IsNeeded       = model.IsNeeded;
                result.TypeName       = model.TypeName;
                _IMasterCategory.Admin_MasterGoogleTypeUpdate(result);
                Response.Redirect("ManageMasterGoogleType");
            }
            return(View(model));
        }