Exemplo n.º 1
0
        public ActionResult DESTINO_LOGISTIC_Update([DataSourceRequest] DataSourceRequest request, DESTINO_LOGISTIC dESTINO_LOGISTIC)
        {
            if (ModelState.IsValid)
            {
                var entity = new DESTINO_LOGISTIC
                {
                    dest_id     = dESTINO_LOGISTIC.dest_id,
                    dest_name   = dESTINO_LOGISTIC.dest_name,
                    dest_addres = dESTINO_LOGISTIC.dest_addres
                };

                db.DESTINO_LOGISTIC.Attach(entity);
                db.Entry(entity).State = EntityState.Modified;
                db.SaveChanges();
            }

            return(Json(new[] { dESTINO_LOGISTIC }.ToDataSourceResult(request, ModelState)));
        }
Exemplo n.º 2
0
        public ActionResult TRANS_LOGISTIC_Update([DataSourceRequest] DataSourceRequest request, TRANS_LOGISTIC tRANS_LOGISTIC)
        {
            if (ModelState.IsValid)
            {
                var entity = new TRANS_LOGISTIC
                {
                    tran_id       = tRANS_LOGISTIC.tran_id,
                    tran_name     = tRANS_LOGISTIC.tran_name,
                    tran_phone    = tRANS_LOGISTIC.tran_phone,
                    tran_user     = tRANS_LOGISTIC.tran_user,
                    tran_password = tRANS_LOGISTIC.tran_password
                };

                db.TRANS_LOGISTIC.Attach(entity);
                db.Entry(entity).State = EntityState.Modified;
                db.SaveChanges();
            }

            return(Json(new[] { tRANS_LOGISTIC }.ToDataSourceResult(request, ModelState)));
        }
Exemplo n.º 3
0
        public ActionResult PRODUCTOS_PV_Update([DataSourceRequest] DataSourceRequest request, PRODUCTOS_PV pRODUCTOS_PV)
        {
            if (ModelState.IsValid)
            {
                var entity = new PRODUCTOS_PV
                {
                    Prod_Id     = pRODUCTOS_PV.Prod_Id,
                    Prod_Codigo = pRODUCTOS_PV.Prod_Codigo,
                    Prod_Name   = pRODUCTOS_PV.Prod_Name,
                    Prod_Price  = pRODUCTOS_PV.Prod_Price,
                    Prod_Desc   = pRODUCTOS_PV.Prod_Desc
                };

                db.PRODUCTOS_PV.Attach(entity);
                db.Entry(entity).State = EntityState.Modified;
                db.SaveChanges();
            }

            return(Json(new[] { pRODUCTOS_PV }.ToDataSourceResult(request, ModelState)));
        }
Exemplo n.º 4
0
        public ActionResult DESTINO_LOGISTIC_COSTO_Update([DataSourceRequest] DataSourceRequest request, vis_Tarifas dESTINO_LOGISTIC_COSTO)
        {
            if (ModelState.IsValid)
            {
                var entity = new DESTINO_LOGISTIC_COSTO
                {
                    cost_id           = dESTINO_LOGISTIC_COSTO.cost_id,
                    dest_ini          = dESTINO_LOGISTIC_COSTO.dest_ini,
                    dest_end          = dESTINO_LOGISTIC_COSTO.dest_end,
                    dest_cost         = dESTINO_LOGISTIC_COSTO.dest_cost,
                    dest_cost_redondo = dESTINO_LOGISTIC_COSTO.dest_cost_redondo
                };

                db.DESTINO_LOGISTIC_COSTO.Attach(entity);
                db.Entry(entity).State = EntityState.Modified;
                db.SaveChanges();
            }

            return(Json(new[] { dESTINO_LOGISTIC_COSTO }.ToDataSourceResult(request, ModelState)));
        }
Exemplo n.º 5
0
        public ActionResult INSTRUCTOR_Update([DataSourceRequest] DataSourceRequest request, INSTRUCTOR iNSTRUCTOR)
        {
            if (ModelState.IsValid)
            {
                int user   = Convert.ToInt32(Session["user_id"].ToString());
                var entity = new INSTRUCTOR
                {
                    inst_id    = iNSTRUCTOR.inst_id,
                    inst_name  = iNSTRUCTOR.inst_name,
                    inst_phone = iNSTRUCTOR.inst_phone,
                    inst_mail  = iNSTRUCTOR.inst_mail,
                    user_id    = user,
                };

                db.INSTRUCTOR.Attach(entity);
                db.Entry(entity).State = EntityState.Modified;
                db.SaveChanges();
            }

            return(Json(new[] { iNSTRUCTOR }.ToDataSourceResult(request, ModelState)));
        }
Exemplo n.º 6
0
        public ActionResult USUARIOS_Update([DataSourceRequest] DataSourceRequest request, USUARIOS_LOGISTIC uSUARIOS)
        {
            if (ModelState.IsValid)
            {
                var entity = new USUARIOS_LOGISTIC
                {
                    user_id       = uSUARIOS.user_id,
                    user_name     = uSUARIOS.user_name,
                    user_phone    = uSUARIOS.user_phone,
                    user_mail     = uSUARIOS.user_mail,
                    user_user     = uSUARIOS.user_user,
                    user_password = uSUARIOS.user_password,
                    user_role     = uSUARIOS.user_role
                };

                db.USUARIOS_LOGISTIC.Attach(entity);
                db.Entry(entity).State = EntityState.Modified;
                db.SaveChanges();
            }

            return(Json(new[] { uSUARIOS }.ToDataSourceResult(request, ModelState)));
        }
Exemplo n.º 7
0
        public ActionResult VISITA_ASSIGN_Update([DataSourceRequest] DataSourceRequest request, VISITA_ASSIGN vISITA_ASSIGN)
        {
            if (ModelState.IsValid)
            {
                var entity = new VISITA_ASSIGN
                {
                    inst_id     = vISITA_ASSIGN.inst_id,
                    cust_id     = vISITA_ASSIGN.cust_id,
                    visi_id     = vISITA_ASSIGN.visi_id,
                    visi_date   = vISITA_ASSIGN.visi_date,
                    visi_op     = vISITA_ASSIGN.visi_op,
                    visi_status = vISITA_ASSIGN.visi_status,
                    visi_hora   = vISITA_ASSIGN.visi_hora,
                    visi_km     = vISITA_ASSIGN.visi_km
                };

                db.VISITA_ASSIGN.Attach(entity);
                db.Entry(entity).State = EntityState.Modified;
                db.SaveChanges();
            }

            return(Json(new[] { vISITA_ASSIGN }.ToDataSourceResult(request, ModelState)));
        }
Exemplo n.º 8
0
        public ActionResult CUSTOMER_Update([DataSourceRequest] DataSourceRequest request, CUSTOMER cUSTOMER)
        {
            if (ModelState.IsValid)
            {
                var entity = new CUSTOMER
                {
                    cust_id       = cUSTOMER.cust_id,
                    cust_name     = cUSTOMER.cust_name,
                    cust_phone    = cUSTOMER.cust_phone,
                    cust_mail     = cUSTOMER.cust_mail,
                    cust_dir      = cUSTOMER.cust_dir,
                    cust_longitud = cUSTOMER.cust_longitud,
                    cust_latitud  = cUSTOMER.cust_latitud,
                    cust_km       = cUSTOMER.cust_km,
                };

                db.CUSTOMER.Attach(entity);
                db.Entry(entity).State = EntityState.Modified;
                db.SaveChanges();
            }

            return(Json(new[] { cUSTOMER }.ToDataSourceResult(request, ModelState)));
        }
Exemplo n.º 9
0
        public ActionResult USUARIO_Update([DataSourceRequest] DataSourceRequest request, USUARIO uSUARIO)
        {
            if (ModelState.IsValid)
            {
                var entity = new USUARIO
                {
                    Usua_Id            = uSUARIO.Usua_Id,
                    Usua_nombre        = uSUARIO.Usua_nombre,
                    Usua_Telefono      = uSUARIO.Usua_Telefono,
                    Usua_Email         = uSUARIO.Usua_Email,
                    Usua_Login         = uSUARIO.Usua_Login,
                    Usua_Password      = uSUARIO.Usua_Password,
                    Usua_Activo        = uSUARIO.Usua_Activo,
                    Usua_FechaCreacion = uSUARIO.Usua_FechaCreacion,
                    Usua_Role          = uSUARIO.Usua_Role
                };

                db.USUARIO.Attach(entity);
                db.Entry(entity).State = EntityState.Modified;
                db.SaveChanges();
            }

            return(Json(new[] { uSUARIO }.ToDataSourceResult(request, ModelState)));
        }