public void PropertyInit()
        {
            VM = new clsPlanGrupoDetVM();

            VM.PlanGrupoDetId  = 0;
            VM.PlanGrupoId     = 0;
            VM.PlanGrupoDetDes = "";
            VM.PlanId          = 0;
            VM.PlanFlujoId     = 0;
            VM.SucursalId      = 0;
            VM.CenCosId        = 0;
            VM.Orden           = 0;
            VM.EstadoId        = 0;
        }
        private void DataMoveDet(clsPlanGrupo oPlanGrupo, clsPlanGrupoDetVM oPlanGrupoDetVM, clsPlanGrupoDet oPlanGrupoDet, bool boolEditing)
        {
            if (boolEditing)
            {
                oPlanGrupoDet.PlanGrupoDetId = SysData.ToLong(oPlanGrupoDetVM.PlanGrupoDetId);
            }

            oPlanGrupoDet.PlanGrupoId     = SysData.ToLong(oPlanGrupo.PlanGrupoId);
            oPlanGrupoDet.PlanGrupoDetDes = SysData.ToStr(oPlanGrupoDetVM.PlanGrupoDetDes);
            oPlanGrupoDet.PlanId          = SysData.ToLong(oPlanGrupoDetVM.PlanId);
            oPlanGrupoDet.PlanFlujoId     = SysData.ToLong(oPlanGrupoDetVM.PlanFlujoId);
            oPlanGrupoDet.SucursalId      = SysData.ToLong(oPlanGrupoDetVM.SucursalId);
            oPlanGrupoDet.CenCosId        = SysData.ToLong(oPlanGrupoDetVM.CenCosId);
            oPlanGrupoDet.Orden           = SysData.ToLong(oPlanGrupoDetVM.Orden);
            oPlanGrupoDet.EstadoId        = SysData.ToLong(oPlanGrupo.EstadoId);
        }
예제 #3
0
        public HttpResponseMessage Post(FormDataCollection form)
        {
            var values = form.Get("values");

            var oPlanGrupoDetVM = new clsPlanGrupoDetVM();

            JsonConvert.PopulateObject(values, oPlanGrupoDetVM);

            Validate(oPlanGrupoDetVM);
            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Error HttpResponseMessage Post"));
            }

            db.PlanGrupoDetList.Add(oPlanGrupoDetVM);
            //db.SaveChanges();

            return(Request.CreateResponse(HttpStatusCode.Created));
        }