public ActionResult Create(Rec_RecruitmentCampaignModel model)
        {
            if (ModelState.IsValid)
            {
                var service = new RestServiceClient <Rec_RecruitmentCampaignModel>(UserLogin);
                service.SetCookies(this.Request.Cookies, _Hrm_Hre_Service);
                var result = service.Put(_Hrm_Hre_Service, "api/Rec_RecruitmentCampaign/", model);

                ViewBag.MsgInsert = "Insert success";
            }
            return(View());
        }
        public Rec_RecruitmentCampaignModel GetById(Guid id)
        {
            string        status  = string.Empty;
            var           model   = new Rec_RecruitmentCampaignModel();
            ActionService service = new ActionService(UserLogin);
            var           entity  = service.GetByIdUseStore <Rec_RecruitmentCampaignEntity>(id, ConstantSql.hrm_rec_sp_get_RecruitmentCampaignById, ref status);//note

            if (entity != null)
            {
                model = entity.CopyData <Rec_RecruitmentCampaignModel>();
            }
            model.ActionStatus = status;
            return(model);
        }
        public Rec_RecruitmentCampaignModel Post([Bind] Rec_RecruitmentCampaignModel model)
        {
            if (model.ID == Guid.Empty)
            {
                model.IsActivate = false;
            }
            #region Validate
            string message       = string.Empty;
            var    checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData <Rec_RecruitmentCampaignModel>(model, "Rec_RecruitmentCampaign", ref message);
            if (!checkValidate)
            {
                model.ActionStatus = message;
                return(model);
            }
            #endregion

            ActionService service = new ActionService(UserLogin);
            return(service.UpdateOrCreate <Rec_RecruitmentCampaignEntity, Rec_RecruitmentCampaignModel>(model));
        }