Ejemplo n.º 1
0
        public dynamic PutAddingPermissionDetails(PermissionDetailsVM p)
        {
            var addingPermissionDetails = db.Storing_Details.Find(p.Id);

            addingPermissionDetails.VIN               = p.vin;
            addingPermissionDetails.PlateNo           = p.plateNo;
            addingPermissionDetails.MotorNo           = p.motorNo;
            addingPermissionDetails.DesiredCategoryId = p.desiredCategoryId;
            addingPermissionDetails.UserId            = p.userId;
            addingPermissionDetails.Storing_Master_Id = p.addingPermissionId;

            var result = db.SaveChanges() > 0 ? true : false;

            return(new
            {
                result = result
            });
        }
Ejemplo n.º 2
0
        public dynamic PostAddingPermissionDetails(PermissionDetailsVM p)
        {
            var addingPermissionDetails = db.Storing_Details.Add(new Storing_Details
            {
                VIN               = p.vin,
                PlateNo           = p.plateNo,
                MotorNo           = p.motorNo,
                DesiredCategoryId = p.desiredCategoryId,
                UserId            = p.userId,
                Storing_Master_Id = p.addingPermissionId
            });
            var result = db.SaveChanges() > 0 ? true : false;

            return(new
            {
                result = result,
                addingPermissionDetailsId = addingPermissionDetails.Id
            });
        }